diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-12-31 18:25:10 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-12-31 18:25:10 -0500 |
| commit | ff5120c584834ede4ff1373fd34c89dd3a6b0f08 (patch) | |
| tree | dbf8c43e5154c7082662a947fa5093f7492290af /std/cstr.zig | |
| parent | 69132bdeda9f9ee672d883fd442b6158d8725422 (diff) | |
| download | zig-ff5120c584834ede4ff1373fd34c89dd3a6b0f08.tar.gz zig-ff5120c584834ede4ff1373fd34c89dd3a6b0f08.zip | |
IR: std makes it to codegen
Diffstat (limited to 'std/cstr.zig')
| -rw-r--r-- | std/cstr.zig | 8 |
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); |
