aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/math.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/math.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/math.zig')
-rw-r--r--test/behavior/math.zig106
1 files changed, 53 insertions, 53 deletions
diff --git a/test/behavior/math.zig b/test/behavior/math.zig
index 14f90ee3fa..42c328c7d4 100644
--- a/test/behavior/math.zig
+++ b/test/behavior/math.zig
@@ -40,7 +40,7 @@ test "assignment operators" {
test "three expr in a row" {
try testThreeExprInARow(false, true);
- comptime try testThreeExprInARow(false, true);
+ try comptime testThreeExprInARow(false, true);
}
fn testThreeExprInARow(f: bool, t: bool) !void {
try assertFalse(f or f or f);
@@ -67,7 +67,7 @@ test "@clz" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testClz();
- comptime try testClz();
+ try comptime testClz();
}
fn testClz() !void {
@@ -86,7 +86,7 @@ test "@clz big ints" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testClzBigInts();
- comptime try testClzBigInts();
+ try comptime testClzBigInts();
}
fn testClzBigInts() !void {
@@ -107,7 +107,7 @@ test "@clz vectors" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testClzVectors();
- comptime try testClzVectors();
+ try comptime testClzVectors();
}
fn testClzVectors() !void {
@@ -147,7 +147,7 @@ test "@ctz" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testCtz();
- comptime try testCtz();
+ try comptime testCtz();
}
fn testCtz() !void {
@@ -176,7 +176,7 @@ test "@ctz vectors" {
}
try testCtzVectors();
- comptime try testCtzVectors();
+ try comptime testCtzVectors();
}
fn testCtzVectors() !void {
@@ -213,7 +213,7 @@ test "float equality" {
const y: f64 = x + 1.0;
try testFloatEqualityImpl(x, y);
- comptime try testFloatEqualityImpl(x, y);
+ try comptime testFloatEqualityImpl(x, y);
}
fn testFloatEqualityImpl(x: f64, y: f64) !void {
@@ -222,7 +222,7 @@ fn testFloatEqualityImpl(x: f64, y: f64) !void {
}
test "hex float literal parsing" {
- comptime try expect(0x1.0 == 1.0);
+ try comptime expect(0x1.0 == 1.0);
}
test "hex float literal within range" {
@@ -323,7 +323,7 @@ test "comptime_int multi-limb partial shift right" {
test "xor" {
try test_xor();
- comptime try test_xor();
+ try comptime test_xor();
}
fn test_xor() !void {
@@ -412,7 +412,7 @@ test "division" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testDivision();
- comptime try testDivision();
+ try comptime testDivision();
}
fn testDivision() !void {
@@ -492,7 +492,7 @@ test "division half-precision floats" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testDivisionFP16();
- comptime try testDivisionFP16();
+ try comptime testDivisionFP16();
}
fn testDivisionFP16() !void {
@@ -527,7 +527,7 @@ fn mod(comptime T: type, a: T, b: T) T {
test "unsigned wrapping" {
try testUnsignedWrappingEval(maxInt(u32));
- comptime try testUnsignedWrappingEval(maxInt(u32));
+ try comptime testUnsignedWrappingEval(maxInt(u32));
}
fn testUnsignedWrappingEval(x: u32) !void {
const zero = x +% 1;
@@ -538,7 +538,7 @@ fn testUnsignedWrappingEval(x: u32) !void {
test "signed wrapping" {
try testSignedWrappingEval(maxInt(i32));
- comptime try testSignedWrappingEval(maxInt(i32));
+ try comptime testSignedWrappingEval(maxInt(i32));
}
fn testSignedWrappingEval(x: i32) !void {
const min_val = x +% 1;
@@ -549,7 +549,7 @@ fn testSignedWrappingEval(x: i32) !void {
test "signed negation wrapping" {
try testSignedNegationWrappingEval(minInt(i16));
- comptime try testSignedNegationWrappingEval(minInt(i16));
+ try comptime testSignedNegationWrappingEval(minInt(i16));
}
fn testSignedNegationWrappingEval(x: i16) !void {
try expect(x == -32768);
@@ -559,7 +559,7 @@ fn testSignedNegationWrappingEval(x: i16) !void {
test "unsigned negation wrapping" {
try testUnsignedNegationWrappingEval(1);
- comptime try testUnsignedNegationWrappingEval(1);
+ try comptime testUnsignedNegationWrappingEval(1);
}
fn testUnsignedNegationWrappingEval(x: u16) !void {
try expect(x == 1);
@@ -586,7 +586,7 @@ test "unsigned 64-bit division" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
try test_u64_div();
- comptime try test_u64_div();
+ try comptime test_u64_div();
}
fn test_u64_div() !void {
const result = divWithResult(1152921504606846976, 34359738365);
@@ -614,7 +614,7 @@ test "truncating shift right" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testShrTrunc(maxInt(u16));
- comptime try testShrTrunc(maxInt(u16));
+ try comptime testShrTrunc(maxInt(u16));
}
fn testShrTrunc(x: u16) !void {
const shifted = x >> 1;
@@ -630,7 +630,7 @@ test "f128" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try test_f128();
- comptime try test_f128();
+ try comptime test_f128();
}
fn make_f128(x: f128) f128 {
@@ -1238,12 +1238,12 @@ test "quad hex float literal parsing accurate" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "truncating shift left" {
try testShlTrunc(maxInt(u16));
- comptime try testShlTrunc(maxInt(u16));
+ try comptime testShlTrunc(maxInt(u16));
}
fn testShlTrunc(x: u16) !void {
const shifted = x << 1;
@@ -1254,7 +1254,7 @@ test "exact shift left" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testShlExact(0b00110101);
- comptime try testShlExact(0b00110101);
+ try comptime testShlExact(0b00110101);
}
fn testShlExact(x: u8) !void {
const shifted = @shlExact(x, 2);
@@ -1265,7 +1265,7 @@ test "exact shift right" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testShrExact(0b10110100);
- comptime try testShrExact(0b10110100);
+ try comptime testShrExact(0b10110100);
}
fn testShrExact(x: u8) !void {
const shifted = @shrExact(x, 2);
@@ -1288,7 +1288,7 @@ test "shift left/right on u0 operand" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "comptime float rem int" {
@@ -1311,11 +1311,11 @@ test "remainder division" {
return error.SkipZigTest;
}
- comptime try remdiv(f16);
- comptime try remdiv(f32);
- comptime try remdiv(f64);
- comptime try remdiv(f80);
- comptime try remdiv(f128);
+ try comptime remdiv(f16);
+ try comptime remdiv(f32);
+ try comptime remdiv(f64);
+ try comptime remdiv(f80);
+ try comptime remdiv(f128);
try remdiv(f16);
try remdiv(f64);
try remdiv(f80);
@@ -1343,11 +1343,11 @@ test "float remainder division using @rem" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
- comptime try frem(f16);
- comptime try frem(f32);
- comptime try frem(f64);
- comptime try frem(f80);
- comptime try frem(f128);
+ try comptime frem(f16);
+ try comptime frem(f32);
+ try comptime frem(f64);
+ try comptime frem(f80);
+ try comptime frem(f128);
try frem(f16);
try frem(f32);
try frem(f64);
@@ -1386,11 +1386,11 @@ test "float modulo division using @mod" {
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
- comptime try fmod(f16);
- comptime try fmod(f32);
- comptime try fmod(f64);
- comptime try fmod(f80);
- comptime try fmod(f128);
+ try comptime fmod(f16);
+ try comptime fmod(f32);
+ try comptime fmod(f64);
+ try comptime fmod(f80);
+ try comptime fmod(f128);
try fmod(f16);
try fmod(f32);
try fmod(f64);
@@ -1430,16 +1430,16 @@ test "@round" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testRound(f64, 12.0);
- comptime try testRound(f64, 12.0);
+ try comptime testRound(f64, 12.0);
try testRound(f32, 12.0);
- comptime try testRound(f32, 12.0);
+ try comptime testRound(f32, 12.0);
try testRound(f16, 12.0);
- comptime try testRound(f16, 12.0);
+ try comptime testRound(f16, 12.0);
const x = 14.0;
const y = x + 0.4;
const z = @round(y);
- comptime try expect(x == z);
+ try comptime expect(x == z);
}
test "@round f80" {
@@ -1451,7 +1451,7 @@ test "@round f80" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testRound(f80, 12.0);
- comptime try testRound(f80, 12.0);
+ try comptime testRound(f80, 12.0);
}
test "@round f128" {
@@ -1463,7 +1463,7 @@ test "@round f128" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testRound(f128, 12.0);
- comptime try testRound(f128, 12.0);
+ try comptime testRound(f128, 12.0);
}
fn testRound(comptime T: type, x: T) !void {
@@ -1491,7 +1491,7 @@ test "vector integer addition" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "NaN comparison" {
@@ -1506,10 +1506,10 @@ test "NaN comparison" {
try testNanEqNan(f32);
try testNanEqNan(f64);
try testNanEqNan(f128);
- comptime try testNanEqNan(f16);
- comptime try testNanEqNan(f32);
- comptime try testNanEqNan(f64);
- comptime try testNanEqNan(f128);
+ try comptime testNanEqNan(f16);
+ try comptime testNanEqNan(f32);
+ try comptime testNanEqNan(f64);
+ try comptime testNanEqNan(f128);
}
test "NaN comparison f80" {
@@ -1521,7 +1521,7 @@ test "NaN comparison f80" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testNanEqNan(f80);
- comptime try testNanEqNan(f80);
+ try comptime testNanEqNan(f80);
}
fn testNanEqNan(comptime F: type) !void {
@@ -1556,7 +1556,7 @@ test "vector comparison" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "compare undefined literal with comptime_int" {
@@ -1593,7 +1593,7 @@ test "signed zeros are represented properly" {
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "comptime sin and ln" {
@@ -1609,7 +1609,7 @@ test "absFloat" {
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
try testAbsFloat();
- comptime try testAbsFloat();
+ try comptime testAbsFloat();
}
fn testAbsFloat() !void {
try testAbsFloatOne(-10.05, 10.05);