aboutsummaryrefslogtreecommitdiff
path: root/std/cstr.zig
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-31 18:25:10 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-31 18:25:10 -0500
commitff5120c584834ede4ff1373fd34c89dd3a6b0f08 (patch)
treedbf8c43e5154c7082662a947fa5093f7492290af /std/cstr.zig
parent69132bdeda9f9ee672d883fd442b6158d8725422 (diff)
downloadzig-ff5120c584834ede4ff1373fd34c89dd3a6b0f08.tar.gz
zig-ff5120c584834ede4ff1373fd34c89dd3a6b0f08.zip
IR: std makes it to codegen
Diffstat (limited to 'std/cstr.zig')
-rw-r--r--std/cstr.zig8
1 files changed, 6 insertions, 2 deletions
diff --git a/std/cstr.zig b/std/cstr.zig
index c994b3c814..e3755b62df 100644
--- a/std/cstr.zig
+++ b/std/cstr.zig
@@ -147,14 +147,18 @@ fn testSimpleCBuf() {
assert(buf.startsWithCBuf(&buf2));
}
+// TODO do this without globals
+
fn testCompileTimeStrCmp() {
@setFnTest(this);
- assert(@staticEval(cmp(c"aoeu", c"aoez") == -1));
+ assert(test_compile_time_str_cmp_result);
}
+const test_compile_time_str_cmp_result = (cmp(c"aoeu", c"aoez") == -1);
fn testCompileTimeStrLen() {
@setFnTest(this);
- assert(@staticEval(len(c"123456789") == 9));
+ assert(test_comptime_str_len_result);
}
+const test_comptime_str_len_result = (len(c"123456789") == 9);