authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-09 22:53:32-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-09-09 22:53:32-04:00
log4c78142af1259adc79ad3e803a58f1d48d8e633d
treebe4d7c08cbb58dc623d19fe822b2197a62ed3f30
parentbc0a60c7a6e772a40fc19becd46f89f34f502759

rename some behavior tests


5 files changed, 15 insertions(+), 15 deletions(-)

test/cases/fn.zig+7-7
...@@ -8,7 +8,7 @@ fn testParamsAdd(a: i32, b: i32) -> i32 {...@@ -8,7 +8,7 @@ fn testParamsAdd(a: i32, b: i32) -> i32 {
8}8}
99
1010
11test "localVariables" {11test "local variables" {
12 testLocVars(2);12 testLocVars(2);
13}13}
14fn testLocVars(b: i32) {14fn testLocVars(b: i32) {
...@@ -17,7 +17,7 @@ fn testLocVars(b: i32) {...@@ -17,7 +17,7 @@ fn testLocVars(b: i32) {
17}17}
1818
1919
20test "voidParameters" {20test "void parameters" {
21 voidFun(1, void{}, 2, {});21 voidFun(1, void{}, 2, {});
22}22}
23fn voidFun(a: i32, b: void, c: i32, d: void) {23fn voidFun(a: i32, b: void, c: i32, d: void) {
...@@ -28,7 +28,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) {...@@ -28,7 +28,7 @@ fn voidFun(a: i32, b: void, c: i32, d: void) {
28}28}
2929
3030
31test "mutableLocalVariables" {31test "mutable local variables" {
32 var zero : i32 = 0;32 var zero : i32 = 0;
33 assert(zero == 0);33 assert(zero == 0);
3434
...@@ -39,7 +39,7 @@ test "mutableLocalVariables" {...@@ -39,7 +39,7 @@ test "mutableLocalVariables" {
39 assert(i == 3);39 assert(i == 3);
40}40}
4141
42test "separateBlockScopes" {42test "separate block scopes" {
43 {43 {
44 const no_conflict : i32 = 5;44 const no_conflict : i32 = 5;
45 assert(no_conflict == 5);45 assert(no_conflict == 5);
...@@ -52,7 +52,7 @@ test "separateBlockScopes" {...@@ -52,7 +52,7 @@ test "separateBlockScopes" {
52 assert(c == 10);52 assert(c == 10);
53}53}
5454
55test "callFnWithEmptyString" {55test "call function with empty string" {
56 acceptsString("");56 acceptsString("");
57}57}
5858
...@@ -66,7 +66,7 @@ test "weird function name" {...@@ -66,7 +66,7 @@ test "weird function name" {
66 assert(@"weird function name"() == 1234);66 assert(@"weird function name"() == 1234);
67}67}
6868
69test "implicitCastFnUnreachableReturn" {69test "implicit cast function unreachable return" {
70 wantsFnWithVoid(fnWithUnreachable);70 wantsFnWithVoid(fnWithUnreachable);
71}71}
7272
...@@ -77,7 +77,7 @@ fn fnWithUnreachable() -> noreturn {...@@ -77,7 +77,7 @@ fn fnWithUnreachable() -> noreturn {
77}77}
7878
7979
80test "functionPointers" {80test "function pointers" {
81 const fns = []@typeOf(fn1) { fn1, fn2, fn3, fn4, };81 const fns = []@typeOf(fn1) { fn1, fn2, fn3, fn4, };
82 for (fns) |f, i| {82 for (fns) |f, i| {
83 assert(f() == u32(i) + 5);83 assert(f() == u32(i) + 5);
test/cases/for.zig+3-3
...@@ -2,7 +2,7 @@ const std = @import("std");...@@ -2,7 +2,7 @@ const std = @import("std");
2const assert = std.debug.assert;2const assert = std.debug.assert;
3const mem = std.mem;3const mem = std.mem;
44
5test "continueInForLoop" {5test "continue in for loop" {
6 const array = []i32 {1, 2, 3, 4, 5};6 const array = []i32 {1, 2, 3, 4, 5};
7 var sum : i32 = 0;7 var sum : i32 = 0;
8 for (array) |x| {8 for (array) |x| {
...@@ -15,7 +15,7 @@ test "continueInForLoop" {...@@ -15,7 +15,7 @@ test "continueInForLoop" {
15 if (sum != 6) unreachable15 if (sum != 6) unreachable
16}16}
1717
18test "forLoopWithPointerElemVar" {18test "for loop with pointer elem var" {
19 const source = "abcdefg";19 const source = "abcdefg";
20 var target: [source.len]u8 = undefined;20 var target: [source.len]u8 = undefined;
21 mem.copy(u8, target[0..], source);21 mem.copy(u8, target[0..], source);
...@@ -28,7 +28,7 @@ fn mangleString(s: []u8) {...@@ -28,7 +28,7 @@ fn mangleString(s: []u8) {
28 }28 }
29}29}
3030
31test "basicForLoop" {31test "basic for loop" {
32 const expected_result = []u8{9, 8, 7, 6, 0, 1, 2, 3, 9, 8, 7, 6, 0, 1, 2, 3 };32 const expected_result = []u8{9, 8, 7, 6, 0, 1, 2, 3, 9, 8, 7, 6, 0, 1, 2, 3 };
3333
34 var buffer: [expected_result.len]u8 = undefined;34 var buffer: [expected_result.len]u8 = undefined;
test/cases/goto.zig+2-2
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const assert = @import("std").debug.assert;1const assert = @import("std").debug.assert;
22
3test "gotoAndLabels" {3test "goto and labels" {
4 gotoLoop();4 gotoLoop();
5 assert(goto_counter == 10);5 assert(goto_counter == 10);
6}6}
...@@ -19,7 +19,7 @@ var goto_counter: i32 = 0;...@@ -19,7 +19,7 @@ var goto_counter: i32 = 0;
1919
2020
2121
22test "gotoLeaveDeferScope" {22test "goto leave defer scope" {
23 testGotoLeaveDeferScope(true);23 testGotoLeaveDeferScope(true);
24}24}
25fn testGotoLeaveDeferScope(b: bool) {25fn testGotoLeaveDeferScope(b: bool) {
test/cases/if.zig+2-2
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const assert = @import("std").debug.assert;1const assert = @import("std").debug.assert;
22
3test "ifStatements" {3test "if statements" {
4 shouldBeEqual(1, 1);4 shouldBeEqual(1, 1);
5 firstEqlThird(2, 1, 2);5 firstEqlThird(2, 1, 2);
6}6}
...@@ -24,7 +24,7 @@ fn firstEqlThird(a: i32, b: i32, c: i32) {...@@ -24,7 +24,7 @@ fn firstEqlThird(a: i32, b: i32, c: i32) {
24}24}
2525
2626
27test "elseIfExpression" {27test "else if expression" {
28 assert(elseIfExpressionF(1) == 1);28 assert(elseIfExpressionF(1) == 1);
29}29}
30fn elseIfExpressionF(c: u8) -> u8 {30fn elseIfExpressionF(c: u8) -> u8 {
test/cases/import.zig+1-1
...@@ -1,6 +1,6 @@...@@ -1,6 +1,6 @@
1const assert = @import("std").debug.assert;1const assert = @import("std").debug.assert;
2const a_namespace = @import("import/a_namespace.zig");2const a_namespace = @import("import/a_namespace.zig");
33
4test "callFnViaNamespaceLookup" {4test "call fn via namespace lookup" {
5 assert(a_namespace.foo() == 1234);5 assert(a_namespace.foo() == 1234);
6}6}