authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-05-23 21:38:31-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2017-05-23 21:38:31-04:00
log68add5d8286e5c517143b16a457a86a6c23dbc64
tree1058b55e8f0b86ad523012c89975ded539fffac5
parent0065eb7c80c2bb68585e42b87131f374e1d3fcbc

clean up behavior test names


21 files changed, 89 insertions(+), 89 deletions(-)

test/cases/array.zig+5-5
......@@ -25,7 +25,7 @@ fn getArrayLen(a: []const u32) -> usize {
2525 a.len
2626}
2727
28test "voidArrays" {
28test "void arrays" {
2929 var array: [4]void = undefined;
3030 array[0] = void{};
3131 array[1] = array[2];
......@@ -33,14 +33,14 @@ test "voidArrays" {
3333 assert(array.len == 4);
3434}
3535
36test "arrayLiteral" {
36test "array literal" {
3737 const hex_mult = []u16{4096, 256, 16, 1};
3838
3939 assert(hex_mult.len == 4);
4040 assert(hex_mult[1] == 256);
4141}
4242
43test "arrayDotLenConstExpr" {
43test "array dot len const expr" {
4444 assert(comptime {some_array.len == 4});
4545}
4646
......@@ -50,7 +50,7 @@ const ArrayDotLenConstExpr = struct {
5050const some_array = []u8 {0, 1, 2, 3};
5151
5252
53test "nestedArrays" {
53test "nested arrays" {
5454 const array_of_strings = [][]const u8 {"hello", "this", "is", "my", "thing"};
5555 for (array_of_strings) |s, i| {
5656 if (i == 0) assert(mem.eql(u8, s, "hello"));
......@@ -69,7 +69,7 @@ const Sub = struct {
6969const Str = struct {
7070 a: []Sub,
7171};
72test "setGlobalVarArrayViaSliceEmbeddedInStruct" {
72test "set global var array via slice embedded in struct" {
7373 var s = Str { .a = s_array[0..]};
7474
7575 s.a[0].b = 1;
test/cases/bool.zig+4-4
......@@ -1,11 +1,11 @@
11const assert = @import("std").debug.assert;
22
3test "boolLiterals" {
3test "bool literals" {
44 assert(true);
55 assert(!false);
66}
77
8test "castBoolToInt" {
8test "cast bool to int" {
99 const t = true;
1010 const f = false;
1111 assert(i32(t) == i32(1));
......@@ -18,7 +18,7 @@ fn nonConstCastBoolToInt(t: bool, f: bool) {
1818 assert(i32(f) == i32(0));
1919}
2020
21test "boolCmp" {
21test "bool cmp" {
2222 assert(testBoolCmp(true, false) == false);
2323}
2424fn testBoolCmp(a: bool, b: bool) -> bool {
......@@ -29,7 +29,7 @@ const global_f = false;
2929const global_t = true;
3030const not_global_f = !global_f;
3131const not_global_t = !global_t;
32test "compileTimeBoolnot" {
32test "compile time bool not" {
3333 assert(not_global_f);
3434 assert(!not_global_t);
3535}
test/cases/cast.zig+2-2
......@@ -8,12 +8,12 @@ test "int to ptr cast" {
88 assert(z == 13);
99}
1010
11test "numLitIntToPtrCast" {
11test "integer literal to pointer cast" {
1212 const vga_mem = @intToPtr(&u16, 0xB8000);
1313 assert(usize(vga_mem) == 0xB8000);
1414}
1515
16test "pointerReinterpretConstFloatToInt" {
16test "pointer reinterpret const float to int" {
1717 const float: f64 = 5.99999999999994648725e-01;
1818 const float_ptr = &float;
1919 const int_ptr = @ptrCast(&i32, float_ptr);
test/cases/const_slice_child.zig+1-1
......@@ -3,7 +3,7 @@ const assert = debug.assert;
33
44var argv: &const &const u8 = undefined;
55
6test "constSliceChild" {
6test "const slice child" {
77 const strs = ([]&const u8) {
88 c"one",
99 c"two",
test/cases/enum.zig+6-6
......@@ -1,7 +1,7 @@
11const assert = @import("std").debug.assert;
22const mem = @import("std").mem;
33
4test "enumType" {
4test "enum type" {
55 const foo1 = Foo.One {13};
66 const foo2 = Foo.Two { Point { .x = 1234, .y = 5678, }};
77 const bar = Bar.B;
......@@ -14,7 +14,7 @@ test "enumType" {
1414 assert(@sizeOf(Bar) == 1);
1515}
1616
17test "enumAsReturnValue" {
17test "enum as return value" {
1818 switch (returnAnInt(13)) {
1919 Foo.One => |value| assert(value == 13),
2020 else => unreachable,
......@@ -42,7 +42,7 @@ fn returnAnInt(x: i32) -> Foo {
4242}
4343
4444
45test "constantEnumWithPayload" {
45test "constant enum with payload" {
4646 var empty = AnEnumWithPayload.Empty;
4747 var full = AnEnumWithPayload.Full {13};
4848 shouldBeEmpty(empty);
......@@ -78,7 +78,7 @@ const Number = enum {
7878 Four,
7979};
8080
81test "enumToInt" {
81test "enum to int" {
8282 shouldEqual(Number.Zero, 0);
8383 shouldEqual(Number.One, 1);
8484 shouldEqual(Number.Two, 2);
......@@ -91,7 +91,7 @@ fn shouldEqual(n: Number, expected: usize) {
9191}
9292
9393
94test "intToEnum" {
94test "int to enum" {
9595 testIntToEnumEval(3);
9696}
9797fn testIntToEnumEval(x: i32) {
......@@ -106,7 +106,7 @@ const IntToEnumNumber = enum {
106106};
107107
108108
109test "enumTagName builtin function" {
109test "@enumTagName" {
110110 assert(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
111111 comptime assert(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
112112}
test/cases/enum_with_members.zig+1-1
......@@ -14,7 +14,7 @@ const ET = enum {
1414 }
1515};
1616
17test "enumWithMembers" {
17test "enum with members" {
1818 const a = ET.SINT { -42 };
1919 const b = ET.UINT { 42 };
2020 var buf: [20]u8 = undefined;
test/cases/error.zig+7-7
......@@ -15,7 +15,7 @@ pub fn baz() -> %i32 {
1515 return y + 1;
1616}
1717
18test "errorWrapping" {
18test "error wrapping" {
1919 assert(%%baz() == 15);
2020}
2121
......@@ -24,7 +24,7 @@ fn gimmeItBroke() -> []const u8 {
2424 @errorName(error.ItBroke)
2525}
2626
27test "errorName" {
27test "@errorName" {
2828 assert(mem.eql(u8, @errorName(error.AnError), "AnError"));
2929 assert(mem.eql(u8, @errorName(error.ALongerErrorName), "ALongerErrorName"));
3030}
......@@ -32,7 +32,7 @@ error AnError;
3232error ALongerErrorName;
3333
3434
35test "errorValues" {
35test "error values" {
3636 const a = i32(error.err1);
3737 const b = i32(error.err2);
3838 assert(a != b);
......@@ -41,7 +41,7 @@ error err1;
4141error err2;
4242
4343
44test "redefinitionOfErrorValuesAllowed" {
44test "redefinition of error values allowed" {
4545 shouldBeNotEqual(error.AnError, error.SecondError);
4646}
4747error AnError;
......@@ -52,7 +52,7 @@ fn shouldBeNotEqual(a: error, b: error) {
5252}
5353
5454
55test "errBinaryOperator" {
55test "error binary operator" {
5656 const a = errBinaryOperatorG(true) %% 3;
5757 const b = errBinaryOperatorG(false) %% 3;
5858 assert(a == 3);
......@@ -68,14 +68,14 @@ fn errBinaryOperatorG(x: bool) -> %isize {
6868}
6969
7070
71test "unwrapSimpleValueFromError" {
71test "unwrap simple value from error" {
7272 const i = %%unwrapSimpleValueFromErrorDo();
7373 assert(i == 13);
7474}
7575fn unwrapSimpleValueFromErrorDo() -> %isize { 13 }
7676
7777
78test "errReturnInAssignment" {
78test "error return in assignment" {
7979 %%doErrReturnInAssignment();
8080}
8181
test/cases/eval.zig+18-18
......@@ -1,7 +1,7 @@
11const assert = @import("std").debug.assert;
22const builtin = @import("builtin");
33
4test "compileTimeRecursion" {
4test "compile time recursion" {
55 assert(some_data.len == 21);
66}
77var some_data: [usize(fibonacci(7))]u8 = undefined;
......@@ -16,11 +16,11 @@ fn unwrapAndAddOne(blah: ?i32) -> i32 {
1616 return ??blah + 1;
1717}
1818const should_be_1235 = unwrapAndAddOne(1234);
19test "testStaticAddOne" {
19test "static add one" {
2020 assert(should_be_1235 == 1235);
2121}
2222
23test "inlinedLoop" {
23test "inlined loop" {
2424 comptime var i = 0;
2525 comptime var sum = 0;
2626 inline while (i <= 5) : (i += 1)
......@@ -34,20 +34,20 @@ fn gimme1or2(comptime a: bool) -> i32 {
3434 comptime var z: i32 = if (a) x else y;
3535 return z;
3636}
37test "inlineVariableGetsResultOfConstIf" {
37test "inline variable gets result of const if" {
3838 assert(gimme1or2(true) == 1);
3939 assert(gimme1or2(false) == 2);
4040}
4141
4242
43test "staticFunctionEvaluation" {
43test "static function evaluation" {
4444 assert(statically_added_number == 3);
4545}
4646const statically_added_number = staticAdd(1, 2);
4747fn staticAdd(a: i32, b: i32) -> i32 { a + b }
4848
4949
50test "constExprEvalOnSingleExprBlocks" {
50test "const expr eval on single expr blocks" {
5151 assert(constExprEvalOnSingleExprBlocksFn(1, true) == 3);
5252}
5353
......@@ -66,7 +66,7 @@ fn constExprEvalOnSingleExprBlocksFn(x: i32, b: bool) -> i32 {
6666
6767
6868
69test "staticallyInitalizedList" {
69test "statically initialized list" {
7070 assert(static_point_list[0].x == 1);
7171 assert(static_point_list[0].y == 2);
7272 assert(static_point_list[1].x == 3);
......@@ -85,7 +85,7 @@ fn makePoint(x: i32, y: i32) -> Point {
8585}
8686
8787
88test "staticEvalListInit" {
88test "static eval list init" {
8989 assert(static_vec3.data[2] == 1.0);
9090 assert(vec3(0.0, 0.0, 3.0).data[2] == 3.0);
9191}
......@@ -100,14 +100,14 @@ pub fn vec3(x: f32, y: f32, z: f32) -> Vec3 {
100100}
101101
102102
103test "constantExpressions" {
103test "constant expressions" {
104104 var array : [array_size]u8 = undefined;
105105 assert(@sizeOf(@typeOf(array)) == 20);
106106}
107107const array_size : u8 = 20;
108108
109109
110test "constantStructWithNegation" {
110test "constant struct with negation" {
111111 assert(vertices[0].x == -0.6);
112112}
113113const Vertex = struct {
......@@ -124,7 +124,7 @@ const vertices = []Vertex {
124124};
125125
126126
127test "staticallyInitalizedStruct" {
127test "statically initialized struct" {
128128 st_init_str_foo.x += 1;
129129 assert(st_init_str_foo.x == 14);
130130}
......@@ -135,14 +135,14 @@ const StInitStrFoo = struct {
135135var st_init_str_foo = StInitStrFoo { .x = 13, .y = true, };
136136
137137
138test "staticallyInitializedArrayLiteral" {
138test "statically initalized array literal" {
139139 const y : [4]u8 = st_init_arr_lit_x;
140140 assert(y[3] == 4);
141141}
142142const st_init_arr_lit_x = []u8{1,2,3,4};
143143
144144
145test "constSlice" {
145test "const slice" {
146146 comptime {
147147 const a = "1234567890";
148148 assert(a.len == 10);
......@@ -152,7 +152,7 @@ test "constSlice" {
152152 }
153153}
154154
155test "tryToTrickEvalWithRuntimeIf" {
155test "try to trick eval with runtime if" {
156156 assert(testTryToTrickEvalWithRuntimeIf(true) == 10);
157157}
158158
......@@ -178,7 +178,7 @@ fn max(comptime T: type, a: T, b: T) -> T {
178178fn letsTryToCompareBools(a: bool, b: bool) -> bool {
179179 max(bool, a, b)
180180}
181test "inlinedBlockAndRuntimeBlockPhi" {
181test "inlined block and runtime block phi" {
182182 assert(letsTryToCompareBools(true, true));
183183 assert(letsTryToCompareBools(true, false));
184184 assert(letsTryToCompareBools(false, true));
......@@ -217,7 +217,7 @@ fn performFn(comptime prefix_char: u8, start_value: i32) -> i32 {
217217 return result;
218218}
219219
220test "comptimeIterateOverFnPtrList" {
220test "comptime iterate over fn ptr list" {
221221 assert(performFn('t', 1) == 6);
222222 assert(performFn('o', 0) == 1);
223223 assert(performFn('w', 99) == 99);
......@@ -256,13 +256,13 @@ var simple_struct = SimpleStruct{ .field = 1234, };
256256
257257const bound_fn = simple_struct.method;
258258
259test "callMethodOnBoundFnReferringToVarInstance" {
259test "call method on bound fn referring to var instance" {
260260 assert(bound_fn() == 1237);
261261}
262262
263263
264264
265test "ptrToLocalArrayArgumentAtComptime" {
265test "ptr to local array argument at comptime" {
266266 comptime {
267267 var bytes: [10]u8 = undefined;
268268 modifySomeBytes(bytes[0..]);
test/cases/ir_block_deps.zig+1-1
......@@ -15,7 +15,7 @@ fn getErrInt() -> %i32 { 0 }
1515
1616error ItBroke;
1717
18test "irBlockDeps" {
18test "ir block deps" {
1919 assert(%%foo(1) == 0);
2020 assert(%%foo(2) == 0);
2121}
test/cases/math.zig+1-1
......@@ -85,7 +85,7 @@ test "assignment operators" {
8585 i |= 3; assert(i == 7);
8686}
8787
88test "threeExprInARow" {
88test "three expr in a row" {
8989 testThreeExprInARow(false, true);
9090 comptime testThreeExprInARow(false, true);
9191}
test/cases/namespace_depends_on_compile_var/index.zig+1-1
......@@ -1,7 +1,7 @@
11const builtin = @import("builtin");
22const assert = @import("std").debug.assert;
33
4test "namespaceDependsOnCompileVar" {
4test "namespace depends on compile var" {
55 if (some_namespace.a_bool) {
66 assert(some_namespace.a_bool);
77 } else {
test/cases/null.zig+6-6
......@@ -1,6 +1,6 @@
11const assert = @import("std").debug.assert;
22
3test "nullableType" {
3test "nullable type" {
44 const x : ?bool = true;
55
66 if (x) |y| {
......@@ -37,7 +37,7 @@ test "test maybe object and get a pointer to the inner value" {
3737}
3838
3939
40test "rhsMaybeUnwrapReturn" {
40test "rhs maybe unwrap return" {
4141 const x: ?bool = true;
4242 const y = x ?? return;
4343}
......@@ -61,7 +61,7 @@ fn foo(x: ?i32) -> ?bool {
6161}
6262
6363
64test "ifVarMaybePointer" {
64test "if var maybe pointer" {
6565 assert(shouldBeAPlus1(Particle {.a = 14, .b = 1, .c = 1, .d = 1}) == 15);
6666}
6767fn shouldBeAPlus1(p: &const Particle) -> u64 {
......@@ -82,7 +82,7 @@ const Particle = struct {
8282};
8383
8484
85test "nullLiteralOutsideFunction" {
85test "null literal outside function" {
8686 const is_null = here_is_a_null_literal.context == null;
8787 assert(is_null);
8888
......@@ -97,7 +97,7 @@ const here_is_a_null_literal = SillyStruct {
9797};
9898
9999
100test "testNullRuntime" {
100test "test null runtime" {
101101 testTestNullRuntime(null);
102102}
103103fn testTestNullRuntime(x: ?i32) {
......@@ -105,7 +105,7 @@ fn testTestNullRuntime(x: ?i32) {
105105 assert(!(x != null));
106106}
107107
108test "nullableVoid" {
108test "nullable void" {
109109 nullableVoidImpl();
110110 comptime nullableVoidImpl();
111111}
test/cases/pub_enum/index.zig+2-2
......@@ -1,13 +1,13 @@
11const other = @import("other.zig");
22const assert = @import("std").debug.assert;
33
4test "pubEnum" {
4test "pub enum" {
55 pubEnumTest(other.APubEnum.Two);
66}
77fn pubEnumTest(foo: other.APubEnum) {
88 assert(foo == other.APubEnum.Two);
99}
1010
11test "castWithImportedSymbol" {
11test "cast with imported symbol" {
1212 assert(other.size_t(42) == 42);
1313}
test/cases/struct.zig+20-20
......@@ -5,12 +5,12 @@ const StructWithNoFields = struct {
55};
66const empty_global_instance = StructWithNoFields {};
77
8test "callStructStaticMethod" {
8test "call struct static method" {
99 const result = StructWithNoFields.add(3, 4);
1010 assert(result == 7);
1111}
1212
13test "returnEmptyStructInstance" {
13test "return empty struct instance" {
1414 _ = returnEmptyStructInstance();
1515}
1616fn returnEmptyStructInstance() -> StructWithNoFields {
......@@ -19,11 +19,11 @@ fn returnEmptyStructInstance() -> StructWithNoFields {
1919
2020const should_be_11 = StructWithNoFields.add(5, 6);
2121
22test "invokeStaticMethodInGlobalScope" {
22test "invake static method in global scope" {
2323 assert(should_be_11 == 11);
2424}
2525
26test "voidStructFields" {
26test "void struct fields" {
2727 const foo = VoidStructFieldsFoo {
2828 .a = void{},
2929 .b = 1,
......@@ -39,7 +39,7 @@ const VoidStructFieldsFoo = struct {
3939};
4040
4141
42test "fn" {
42test "structs" {
4343 var foo: StructFoo = undefined;
4444 @memset(@ptrCast(&u8, &foo), 0, @sizeOf(StructFoo));
4545 foo.a += 1;
......@@ -70,7 +70,7 @@ const Val = struct {
7070 x: i32,
7171};
7272
73test "structPointToSelf" {
73test "struct point to self" {
7474 var root : Node = undefined;
7575 root.val.x = 1;
7676
......@@ -83,7 +83,7 @@ test "structPointToSelf" {
8383 assert(node.next.next.next.val.x == 1);
8484}
8585
86test "structByvalAssign" {
86test "struct byval assign" {
8787 var foo1 : StructFoo = undefined;
8888 var foo2 : StructFoo = undefined;
8989
......@@ -100,7 +100,7 @@ fn structInitializer() {
100100}
101101
102102
103test "fnCallOfStructField" {
103test "fn call of struct field" {
104104 assert(callStructField(Foo {.ptr = aFunc,}) == 13);
105105}
106106
......@@ -115,7 +115,7 @@ fn callStructField(foo: &const Foo) -> i32 {
115115}
116116
117117
118test "storeMemberFunctionInVariable" {
118test "store member function in variable" {
119119 const instance = MemberFnTestFoo { .x = 1234, };
120120 const memberFn = MemberFnTestFoo.member;
121121 const result = memberFn(instance);
......@@ -127,13 +127,13 @@ const MemberFnTestFoo = struct {
127127};
128128
129129
130test "callMemberFunctionDirectly" {
130test "call member function directly" {
131131 const instance = MemberFnTestFoo { .x = 1234, };
132132 const result = MemberFnTestFoo.member(instance);
133133 assert(result == 1234);
134134}
135135
136test "memberFunctions" {
136test "member functions" {
137137 const r = MemberFnRand {.seed = 1234};
138138 assert(r.getSeed() == 1234);
139139}
......@@ -144,7 +144,7 @@ const MemberFnRand = struct {
144144 }
145145};
146146
147test "returnStructByvalFromFunction" {
147test "return struct byval from function" {
148148 const bar = makeBar(1234, 5678);
149149 assert(bar.y == 5678);
150150}
......@@ -159,7 +159,7 @@ fn makeBar(x: i32, y: i32) -> Bar {
159159 }
160160}
161161
162test "emptyStructMethodCall" {
162test "empty struct method call" {
163163 const es = EmptyStruct{};
164164 assert(es.method() == 1234);
165165}
......@@ -170,7 +170,7 @@ const EmptyStruct = struct {
170170};
171171
172172
173test "returnEmptyStructFromFn" {
173test "return empty struct from fn" {
174174 _ = testReturnEmptyStructFromFn();
175175}
176176const EmptyStruct2 = struct {};
......@@ -178,7 +178,7 @@ fn testReturnEmptyStructFromFn() -> EmptyStruct2 {
178178 EmptyStruct2 {}
179179}
180180
181test "passSliceOfEmptyStructToFn" {
181test "pass slice of empty struct to fn" {
182182 assert(testPassSliceOfEmptyStructToFn([]EmptyStruct2{ EmptyStruct2{} }) == 1);
183183}
184184fn testPassSliceOfEmptyStructToFn(slice: []const EmptyStruct2) -> usize {
......@@ -190,7 +190,7 @@ const APackedStruct = packed struct {
190190 y: u8,
191191};
192192
193test "packedStruct" {
193test "packed struct" {
194194 var foo = APackedStruct {
195195 .x = 1,
196196 .y = 2,
......@@ -216,7 +216,7 @@ const bit_field_1 = BitField1 {
216216 .c = 3,
217217};
218218
219test "bitFieldAccess" {
219test "bit field access" {
220220 var data = bit_field_1;
221221 assert(getA(&data) == 1);
222222 assert(getB(&data) == 2);
......@@ -254,7 +254,7 @@ const Foo96Bits = packed struct {
254254 d: u24,
255255};
256256
257test "packedStruct24Bits" {
257test "packed struct 24bits" {
258258 comptime {
259259 assert(@sizeOf(Foo24Bits) == 3);
260260 assert(@sizeOf(Foo96Bits) == 12);
......@@ -297,7 +297,7 @@ const FooArray24Bits = packed struct {
297297 c: u16,
298298};
299299
300test "packedArray24Bits" {
300test "packed array 24bits" {
301301 comptime {
302302 assert(@sizeOf([9]Foo24Bits) == 9 * 3);
303303 assert(@sizeOf(FooArray24Bits) == 2 + 2 * 3 + 2);
......@@ -347,7 +347,7 @@ const FooArrayOfAligned = packed struct {
347347 a: [2]FooStructAligned,
348348};
349349
350test "alignedArrayOfPackedStruct" {
350test "aligned array of packed struct" {
351351 comptime {
352352 assert(@sizeOf(FooStructAligned) == 2);
353353 assert(@sizeOf(FooArrayOfAligned) == 2 * 2);
test/cases/switch_prong_err_enum.zig+1-1
......@@ -21,7 +21,7 @@ fn doThing(form_id: u64) -> %FormValue {
2121 }
2222}
2323
24test "switchProngReturnsErrorEnum" {
24test "switch prong returns error enum" {
2525 switch (%%doThing(17)) {
2626 FormValue.Address => |payload| { assert(payload == 1); },
2727 else => unreachable,
test/cases/switch_prong_implicit_cast.zig+1-1
......@@ -15,7 +15,7 @@ fn foo(id: u64) -> %FormValue {
1515 }
1616}
1717
18test "switchProngImplicitCast" {
18test "switch prong implicit cast" {
1919 const result = switch (%%foo(2)) {
2020 FormValue.One => false,
2121 FormValue.Two => |x| x,
test/cases/this.zig+3-3
......@@ -28,11 +28,11 @@ fn factorial(x: i32) -> i32 {
2828 }
2929}
3030
31test "thisReferToModuleCallPrivateFn" {
31test "this refer to module call private fn" {
3232 assert(module.add(1, 2) == 3);
3333}
3434
35test "thisReferToContainer" {
35test "this refer to container" {
3636 var pt = Point(i32) {
3737 .x = 12,
3838 .y = 34,
......@@ -42,6 +42,6 @@ test "thisReferToContainer" {
4242 assert(pt.y == 35);
4343}
4444
45test "thisReferToFn" {
45test "this refer to fn" {
4646 assert(factorial(5) == 120);
4747}
test/cases/try.zig+2-2
......@@ -1,6 +1,6 @@
11const assert = @import("std").debug.assert;
22
3test "tryOnErrorUnion" {
3test "try on error union" {
44 tryOnErrorUnionImpl();
55 comptime tryOnErrorUnionImpl();
66
......@@ -24,7 +24,7 @@ fn returnsTen() -> %i32 {
2424 10
2525}
2626
27test "tryWithoutVars" {
27test "try without vars" {
2828 const result1 = if (failIfTrue(true)) {
2929 1
3030 } else |_| {
test/cases/undefined.zig+3-3
......@@ -9,7 +9,7 @@ fn initStaticArray() -> [10]i32 {
99 return array;
1010}
1111const static_array = initStaticArray();
12test "initStaticArrayToUndefined" {
12test "init static array to undefined" {
1313 assert(static_array[0] == 1);
1414 assert(static_array[4] == 2);
1515 assert(static_array[7] == 3);
......@@ -35,7 +35,7 @@ fn setFooX(foo: &Foo) {
3535 foo.x = 2;
3636}
3737
38test "assignUndefinedToStruct" {
38test "assign undefined to struct" {
3939 comptime {
4040 var foo: Foo = undefined;
4141 setFooX(&foo);
......@@ -48,7 +48,7 @@ test "assignUndefinedToStruct" {
4848 }
4949}
5050
51test "assignUndefinedToStructWithMethod" {
51test "assign undefined to struct with method" {
5252 comptime {
5353 var foo: Foo = undefined;
5454 foo.setFooXMethod();
test/cases/var_args.zig+3-3
......@@ -8,7 +8,7 @@ fn add(args: ...) -> i32 {
88 return sum;
99}
1010
11test "testAddArbitraryArgs" {
11test "add arbitrary args" {
1212 assert(add(i32(1), i32(2), i32(3), i32(4)) == 10);
1313 assert(add(i32(1234)) == 1234);
1414 assert(add() == 0);
......@@ -18,11 +18,11 @@ fn readFirstVarArg(args: ...) {
1818 const value = args[0];
1919}
2020
21test "sendVoidArgToVarArgs" {
21test "send void arg to var args" {
2222 readFirstVarArg({});
2323}
2424
25test "testPassArgsDirectly" {
25test "pass args directly" {
2626 assert(addSomeStuff(i32(1), i32(2), i32(3), i32(4)) == 10);
2727 assert(addSomeStuff(i32(1234)) == 1234);
2828 assert(addSomeStuff() == 0);
test/cases/void.zig+1-1
......@@ -6,7 +6,7 @@ const Foo = struct {
66 c: void,
77};
88
9test "compareVoidWithVoidCompileTimeKnown" {
9test "compare void with void compile time known" {
1010 comptime {
1111 const foo = Foo {
1212 .a = {},