authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-19 00:53:18-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-12-19 00:53:18-05:00
log14422e0312b3df271bfb60e8a6233afb128354fc
tree4cf7fc78760db1488505651c0829fd0989508c62
parent6b2d06710c52c348aa01b62007a2e990b47eee72

organize tests


6 files changed, 27 insertions(+), 33 deletions(-)

test/cases3/disabled_export.zig deleted-8
...@@ -1,8 +0,0 @@
1export fn disabledExternFn() {
2 @setFnVisible(this, false);
3}
4
5fn callDisabledExternFn() {
6 @setFnTest(this);
7 disabledExternFn();
8}
test/cases3/empty_fn_with_comments.zig deleted-6
...@@ -1,6 +0,0 @@
1// normal comment
2/// this is a documentation comment
3/// doc comment line 2
4fn emptyFunctionWithComments() {
5 @setFnTest(this);
6}
test/cases3/generics.zig+10
...@@ -40,6 +40,16 @@ fn fnWithInlineArgs() {...@@ -40,6 +40,16 @@ fn fnWithInlineArgs() {
40 assert(sameButWithFloats(0.43, 0.49) == 0.49);40 assert(sameButWithFloats(0.43, 0.49) == 0.49);
41}41}
4242
43fn inlinedLoop() {
44 @setFnTest(this);
45
46 inline var i = 0;
47 inline var sum = 0;
48 inline while (i <= 5; i += 1)
49 sum += i;
50 assert(sum == 15);
51}
52
4353
44// TODO const assert = @import("std").debug.assert;54// TODO const assert = @import("std").debug.assert;
45fn assert(ok: bool) {55fn assert(ok: bool) {
test/cases3/inlined_loop.zig deleted-16
...@@ -1,16 +0,0 @@
1
2fn inlinedLoop() {
3 @setFnTest(this);
4
5 inline var i = 0;
6 inline var sum = 0;
7 inline while (i <= 5; i += 1)
8 sum += i;
9 assert(sum == 15);
10}
11
12// TODO const assert = @import("std").debug.assert;
13fn assert(ok: bool) {
14 if (!ok)
15 @unreachable();
16}
test/cases3/misc.zig+17
...@@ -1,3 +1,20 @@...@@ -1,3 +1,20 @@
1// normal comment
2/// this is a documentation comment
3/// doc comment line 2
4fn emptyFunctionWithComments() {
5 @setFnTest(this);
6}
7
8export fn disabledExternFn() {
9 @setFnVisible(this, false);
10}
11
12fn callDisabledExternFn() {
13 @setFnTest(this);
14
15 disabledExternFn();
16}
17
1fn intTypeBuiltin() {18fn intTypeBuiltin() {
2 @setFnTest(this);19 @setFnTest(this);
320
test/self_hosted3.zig-3
...@@ -1,7 +1,4 @@...@@ -1,7 +1,4 @@
1// TODO '_' identifier for unused variable bindings1// TODO '_' identifier for unused variable bindings
2const test_empty_fn_with_comments = @import("cases3/empty_fn_with_comments.zig");
3const test_disabled_export = @import("cases3/disabled_export.zig");
4const test_inlined_loop = @import("cases3/inlined_loop.zig");
5const test_misc = @import("cases3/misc.zig");2const test_misc = @import("cases3/misc.zig");
6const test_switch = @import("cases3/switch.zig");3const test_switch = @import("cases3/switch.zig");
7const test_error = @import("cases3/error.zig");4const test_error = @import("cases3/error.zig");