aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-03 19:38:36 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-03 19:38:36 -0700
commite64c0941f9cff66311c969b85be5fe5575c4ce45 (patch)
treea3417dd85241d55362433f41e00b72d4d2cba435 /test/run_tests.cpp
parentfa6e3eec464227a2c20ca949e2fd12f3ab649960 (diff)
downloadzig-e64c0941f9cff66311c969b85be5fe5575c4ce45.tar.gz
zig-e64c0941f9cff66311c969b85be5fe5575c4ce45.zip
implement #sizeof()
closes #8
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index 7fb46bfcd7..43bcae7456 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -698,16 +698,17 @@ fn outer() -> isize {
}
)SOURCE", "OK\n");
- add_simple_case("#typeof()", R"SOURCE(
+ add_simple_case("#sizeof() and #typeof()", R"SOURCE(
use "std.zig";
const x: u16 = 13;
const z: #typeof(x) = 19;
pub fn main(argc : isize, argv : &&u8, env : &&u8) -> i32 {
const y: #typeof(x) = 120;
- print_str("OK\n");
+ print_u64(#sizeof(#typeof(y)));
+ print_str("\n");
return 0;
}
- )SOURCE", "OK\n");
+ )SOURCE", "2\n");
}
////////////////////////////////////////////////////////////////////////////////////