aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/switch.zig
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2023-06-05 14:29:28 +0600
committerEric Joldasov <bratishkaerik@getgoogleoff.me>2023-06-13 23:46:58 +0600
commitd884d7050e061c620324aaaabfba507e08cb40f4 (patch)
treefa0b5994341509ef81d7244788ea3e37b13f6d27 /test/behavior/switch.zig
parent6078781ae52fc2c85559f622f58c303b73d8a6a5 (diff)
downloadzig-d884d7050e061c620324aaaabfba507e08cb40f4.tar.gz
zig-d884d7050e061c620324aaaabfba507e08cb40f4.zip
all: replace `comptime try` with `try comptime`
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Diffstat (limited to 'test/behavior/switch.zig')
-rw-r--r--test/behavior/switch.zig40
1 files changed, 20 insertions, 20 deletions
diff --git a/test/behavior/switch.zig b/test/behavior/switch.zig
index 72a36c9883..02e3ef4dce 100644
--- a/test/behavior/switch.zig
+++ b/test/behavior/switch.zig
@@ -121,7 +121,7 @@ test "switching on booleans" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testSwitchOnBools();
- comptime try testSwitchOnBools();
+ try comptime testSwitchOnBools();
}
fn testSwitchOnBools() !void {
@@ -186,10 +186,10 @@ test "switch variable for range and multiple prongs" {
fn doTheTest() !void {
var u: u8 = 16;
try doTheSwitch(u);
- comptime try doTheSwitch(u);
+ try comptime doTheSwitch(u);
var v: u8 = 42;
try doTheSwitch(v);
- comptime try doTheSwitch(v);
+ try comptime doTheSwitch(v);
}
fn doTheSwitch(q: u8) !void {
switch (q) {
@@ -260,7 +260,7 @@ test "switch on enum using pointer capture" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testSwitchEnumPtrCapture();
- comptime try testSwitchEnumPtrCapture();
+ try comptime testSwitchEnumPtrCapture();
}
fn testSwitchEnumPtrCapture() !void {
@@ -279,7 +279,7 @@ test "switch handles all cases of number" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
try testSwitchHandleAllCases();
- comptime try testSwitchHandleAllCases();
+ try comptime testSwitchHandleAllCases();
}
fn testSwitchHandleAllCases() !void {
@@ -373,7 +373,7 @@ test "switch all prongs unreachable" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
try testAllProngsUnreachable();
- comptime try testAllProngsUnreachable();
+ try comptime testAllProngsUnreachable();
}
fn testAllProngsUnreachable() !void {
@@ -421,7 +421,7 @@ test "switch on integer with else capturing expr" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "else prong of switch on error set excludes other cases" {
@@ -456,7 +456,7 @@ test "else prong of switch on error set excludes other cases" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "switch prongs with error set cases make a new error set type for capture value" {
@@ -493,7 +493,7 @@ test "switch prongs with error set cases make a new error set type for capture v
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "return result loc and then switch with range implicit casted to error union" {
@@ -512,7 +512,7 @@ test "return result loc and then switch with range implicit casted to error unio
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "switch with null and T peer types and inferred result location type" {
@@ -532,7 +532,7 @@ test "switch with null and T peer types and inferred result location type" {
}
};
try S.doTheTest(1);
- comptime try S.doTheTest(1);
+ try comptime S.doTheTest(1);
}
test "switch prongs with cases with identical payload types" {
@@ -577,7 +577,7 @@ test "switch prongs with cases with identical payload types" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "switch on pointer type" {
@@ -606,9 +606,9 @@ test "switch on pointer type" {
try expect(1 == S.doTheTest(S.P1));
try expect(2 == S.doTheTest(S.P2));
try expect(3 == S.doTheTest(S.P3));
- comptime try expect(1 == S.doTheTest(S.P1));
- comptime try expect(2 == S.doTheTest(S.P2));
- comptime try expect(3 == S.doTheTest(S.P3));
+ try comptime expect(1 == S.doTheTest(S.P1));
+ try comptime expect(2 == S.doTheTest(S.P2));
+ try comptime expect(3 == S.doTheTest(S.P3));
}
test "switch on error set with single else" {
@@ -624,7 +624,7 @@ test "switch on error set with single else" {
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "switch capture copies its payload" {
@@ -650,7 +650,7 @@ test "switch capture copies its payload" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "capture of integer forwards the switch condition directly" {
@@ -670,8 +670,8 @@ test "capture of integer forwards the switch condition directly" {
};
try S.foo(42);
try S.foo(100);
- comptime try S.foo(42);
- comptime try S.foo(100);
+ try comptime S.foo(42);
+ try comptime S.foo(100);
}
test "enum value without tag name used as switch item" {
@@ -702,7 +702,7 @@ test "switch item sizeof" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "comptime inline switch" {