aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/base64.zig4
-rw-r--r--lib/std/cstr.zig2
-rw-r--r--lib/std/math.zig26
-rw-r--r--lib/std/mem.zig12
-rw-r--r--lib/std/meta.zig2
-rw-r--r--lib/std/meta/trait.zig4
-rw-r--r--lib/std/rand/test.zig10
-rw-r--r--lib/std/unicode.zig30
8 files changed, 45 insertions, 45 deletions
diff --git a/lib/std/base64.zig b/lib/std/base64.zig
index 758c7c8b58..869fa47e5e 100644
--- a/lib/std/base64.zig
+++ b/lib/std/base64.zig
@@ -302,7 +302,7 @@ pub const Base64DecoderWithIgnore = struct {
test "base64" {
@setEvalBranchQuota(8000);
try testBase64();
- comptime try testAllApis(standard, "comptime", "Y29tcHRpbWU=");
+ try comptime testAllApis(standard, "comptime", "Y29tcHRpbWU=");
}
test "base64 padding dest overflow" {
@@ -322,7 +322,7 @@ test "base64 padding dest overflow" {
test "base64 url_safe_no_pad" {
@setEvalBranchQuota(8000);
try testBase64UrlSafeNoPad();
- comptime try testAllApis(url_safe_no_pad, "comptime", "Y29tcHRpbWU");
+ try comptime testAllApis(url_safe_no_pad, "comptime", "Y29tcHRpbWU");
}
fn testBase64() !void {
diff --git a/lib/std/cstr.zig b/lib/std/cstr.zig
index 8a203e5c8e..9bd98a72b7 100644
--- a/lib/std/cstr.zig
+++ b/lib/std/cstr.zig
@@ -22,7 +22,7 @@ pub fn cmp(a: [*:0]const u8, b: [*:0]const u8) i8 {
}
test "cstr fns" {
- comptime try testCStrFnsImpl();
+ try comptime testCStrFnsImpl();
try testCStrFnsImpl();
}
diff --git a/lib/std/math.zig b/lib/std/math.zig
index d85cefdefb..46a7e40a37 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -854,7 +854,7 @@ test "IntFittingRange" {
test "overflow functions" {
try testOverflow();
- comptime try testOverflow();
+ try comptime testOverflow();
}
fn testOverflow() !void {
@@ -898,7 +898,7 @@ pub fn absInt(x: anytype) !@TypeOf(x) {
test "absInt" {
try testAbsInt();
- comptime try testAbsInt();
+ try comptime testAbsInt();
}
fn testAbsInt() !void {
try testing.expect((absInt(@as(i32, -10)) catch unreachable) == 10);
@@ -920,7 +920,7 @@ pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
test "divTrunc" {
try testDivTrunc();
- comptime try testDivTrunc();
+ try comptime testDivTrunc();
}
fn testDivTrunc() !void {
try testing.expect((divTrunc(i32, 5, 3) catch unreachable) == 1);
@@ -944,7 +944,7 @@ pub fn divFloor(comptime T: type, numerator: T, denominator: T) !T {
test "divFloor" {
try testDivFloor();
- comptime try testDivFloor();
+ try comptime testDivFloor();
}
fn testDivFloor() !void {
try testing.expect((divFloor(i32, 5, 3) catch unreachable) == 1);
@@ -981,7 +981,7 @@ pub fn divCeil(comptime T: type, numerator: T, denominator: T) !T {
test "divCeil" {
try testDivCeil();
- comptime try testDivCeil();
+ try comptime testDivCeil();
}
fn testDivCeil() !void {
try testing.expectEqual(@as(i32, 2), divCeil(i32, 5, 3) catch unreachable);
@@ -1025,7 +1025,7 @@ pub fn divExact(comptime T: type, numerator: T, denominator: T) !T {
test "divExact" {
try testDivExact();
- comptime try testDivExact();
+ try comptime testDivExact();
}
fn testDivExact() !void {
try testing.expect((divExact(i32, 10, 5) catch unreachable) == 2);
@@ -1051,7 +1051,7 @@ pub fn mod(comptime T: type, numerator: T, denominator: T) !T {
test "mod" {
try testMod();
- comptime try testMod();
+ try comptime testMod();
}
fn testMod() !void {
try testing.expect((mod(i32, -5, 3) catch unreachable) == 1);
@@ -1077,7 +1077,7 @@ pub fn rem(comptime T: type, numerator: T, denominator: T) !T {
test "rem" {
try testRem();
- comptime try testRem();
+ try comptime testRem();
}
fn testRem() !void {
try testing.expect((rem(i32, -5, 3) catch unreachable) == -2);
@@ -1253,7 +1253,7 @@ pub fn floorPowerOfTwo(comptime T: type, value: T) T {
test "floorPowerOfTwo" {
try testFloorPowerOfTwo();
- comptime try testFloorPowerOfTwo();
+ try comptime testFloorPowerOfTwo();
}
fn testFloorPowerOfTwo() !void {
@@ -1315,7 +1315,7 @@ pub fn ceilPowerOfTwoAssert(comptime T: type, value: T) T {
test "ceilPowerOfTwoPromote" {
try testCeilPowerOfTwoPromote();
- comptime try testCeilPowerOfTwoPromote();
+ try comptime testCeilPowerOfTwoPromote();
}
fn testCeilPowerOfTwoPromote() !void {
@@ -1332,7 +1332,7 @@ fn testCeilPowerOfTwoPromote() !void {
test "ceilPowerOfTwo" {
try testCeilPowerOfTwo();
- comptime try testCeilPowerOfTwo();
+ try comptime testCeilPowerOfTwo();
}
fn testCeilPowerOfTwo() !void {
@@ -1751,7 +1751,7 @@ test "boolMask" {
}
}.runTest;
try runTest();
- comptime try runTest();
+ try comptime runTest();
}
/// Return the mod of `num` with the smallest integer type
@@ -1882,5 +1882,5 @@ test "sign" {
return error.SkipZigTest;
}
try testSign();
- comptime try testSign();
+ try comptime testSign();
}
diff --git a/lib/std/mem.zig b/lib/std/mem.zig
index d6ca4a9ea1..cd65323569 100644
--- a/lib/std/mem.zig
+++ b/lib/std/mem.zig
@@ -3101,7 +3101,7 @@ test "testStringEquality" {
test "testReadInt" {
try testReadIntImpl();
- comptime try testReadIntImpl();
+ try comptime testReadIntImpl();
}
fn testReadIntImpl() !void {
{
@@ -3152,7 +3152,7 @@ fn testReadIntImpl() !void {
test writeIntSlice {
try testWriteIntImpl();
- comptime try testWriteIntImpl();
+ try comptime testWriteIntImpl();
}
fn testWriteIntImpl() !void {
var bytes: [8]u8 = undefined;
@@ -4069,13 +4069,13 @@ test "bytesAsSlice keeps pointer alignment" {
{
var bytes = [_]u8{ 0x01, 0x02, 0x03, 0x04 };
const numbers = bytesAsSlice(u32, bytes[0..]);
- comptime try testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
+ try comptime testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
}
{
var bytes = [_]u8{ 0x01, 0x02, 0x03, 0x04 };
var runtime_zero: usize = 0;
const numbers = bytesAsSlice(u32, bytes[runtime_zero..]);
- comptime try testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
+ try comptime testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
}
}
@@ -4168,7 +4168,7 @@ test "sliceAsBytes packed struct at runtime and comptime" {
}
};
try S.doTheTest();
- comptime try S.doTheTest();
+ try comptime S.doTheTest();
}
test "sliceAsBytes and bytesAsSlice back" {
@@ -4557,7 +4557,7 @@ test "read/write(Var)PackedInt" {
}
const signedness = @typeInfo(PackedType).Int.signedness;
- const NextPowerOfTwoInt = std.meta.Int(signedness, comptime try std.math.ceilPowerOfTwo(u16, @bitSizeOf(PackedType)));
+ const NextPowerOfTwoInt = std.meta.Int(signedness, try comptime std.math.ceilPowerOfTwo(u16, @bitSizeOf(PackedType)));
const ui64 = std.meta.Int(signedness, 64);
inline for ([_]type{ PackedType, NextPowerOfTwoInt, ui64 }) |U| {
{ // Variable-size Read/Write (Native-endian)
diff --git a/lib/std/meta.zig b/lib/std/meta.zig
index 28709750c7..db415199ed 100644
--- a/lib/std/meta.zig
+++ b/lib/std/meta.zig
@@ -210,7 +210,7 @@ pub fn sentinel(comptime T: type) ?Elem(T) {
test "std.meta.sentinel" {
try testSentinel();
- comptime try testSentinel();
+ try comptime testSentinel();
}
fn testSentinel() !void {
diff --git a/lib/std/meta/trait.zig b/lib/std/meta/trait.zig
index e8cf9bd3fc..3d0e0bce5d 100644
--- a/lib/std/meta/trait.zig
+++ b/lib/std/meta/trait.zig
@@ -222,8 +222,8 @@ pub fn isSingleItemPtr(comptime T: type) bool {
test "isSingleItemPtr" {
const array = [_]u8{0} ** 10;
- comptime try testing.expect(isSingleItemPtr(@TypeOf(&array[0])));
- comptime try testing.expect(!isSingleItemPtr(@TypeOf(array)));
+ try comptime testing.expect(isSingleItemPtr(@TypeOf(&array[0])));
+ try comptime testing.expect(!isSingleItemPtr(@TypeOf(array)));
var runtime_zero: usize = 0;
try testing.expect(!isSingleItemPtr(@TypeOf(array[runtime_zero..1])));
}
diff --git a/lib/std/rand/test.zig b/lib/std/rand/test.zig
index 1ad9adbeb8..d257425ad1 100644
--- a/lib/std/rand/test.zig
+++ b/lib/std/rand/test.zig
@@ -79,7 +79,7 @@ const Dilbert = struct {
test "Random int" {
try testRandomInt();
- comptime try testRandomInt();
+ try comptime testRandomInt();
}
fn testRandomInt() !void {
var rng = SequentialPrng.init();
@@ -126,7 +126,7 @@ fn testRandomInt() !void {
test "Random boolean" {
try testRandomBoolean();
- comptime try testRandomBoolean();
+ try comptime testRandomBoolean();
}
fn testRandomBoolean() !void {
var rng = SequentialPrng.init();
@@ -140,7 +140,7 @@ fn testRandomBoolean() !void {
test "Random enum" {
try testRandomEnumValue();
- comptime try testRandomEnumValue();
+ try comptime testRandomEnumValue();
}
fn testRandomEnumValue() !void {
const TestEnum = enum {
@@ -159,7 +159,7 @@ fn testRandomEnumValue() !void {
test "Random intLessThan" {
@setEvalBranchQuota(10000);
try testRandomIntLessThan();
- comptime try testRandomIntLessThan();
+ try comptime testRandomIntLessThan();
}
fn testRandomIntLessThan() !void {
var rng = SequentialPrng.init();
@@ -201,7 +201,7 @@ fn testRandomIntLessThan() !void {
test "Random intAtMost" {
@setEvalBranchQuota(10000);
try testRandomIntAtMost();
- comptime try testRandomIntAtMost();
+ try comptime testRandomIntAtMost();
}
fn testRandomIntAtMost() !void {
var rng = SequentialPrng.init();
diff --git a/lib/std/unicode.zig b/lib/std/unicode.zig
index 9d334218c1..1987d10b0d 100644
--- a/lib/std/unicode.zig
+++ b/lib/std/unicode.zig
@@ -354,11 +354,11 @@ fn testUtf16CountCodepoints() !void {
test "utf16 count codepoints" {
try testUtf16CountCodepoints();
- comptime try testUtf16CountCodepoints();
+ try comptime testUtf16CountCodepoints();
}
test "utf8 encode" {
- comptime try testUtf8Encode();
+ try comptime testUtf8Encode();
try testUtf8Encode();
}
fn testUtf8Encode() !void {
@@ -384,7 +384,7 @@ fn testUtf8Encode() !void {
}
test "utf8 encode error" {
- comptime try testUtf8EncodeError();
+ try comptime testUtf8EncodeError();
try testUtf8EncodeError();
}
fn testUtf8EncodeError() !void {
@@ -400,7 +400,7 @@ fn testErrorEncode(codePoint: u21, array: []u8, expectedErr: anyerror) !void {
}
test "utf8 iterator on ascii" {
- comptime try testUtf8IteratorOnAscii();
+ try comptime testUtf8IteratorOnAscii();
try testUtf8IteratorOnAscii();
}
fn testUtf8IteratorOnAscii() !void {
@@ -420,7 +420,7 @@ fn testUtf8IteratorOnAscii() !void {
}
test "utf8 view bad" {
- comptime try testUtf8ViewBad();
+ try comptime testUtf8ViewBad();
try testUtf8ViewBad();
}
fn testUtf8ViewBad() !void {
@@ -430,7 +430,7 @@ fn testUtf8ViewBad() !void {
}
test "utf8 view ok" {
- comptime try testUtf8ViewOk();
+ try comptime testUtf8ViewOk();
try testUtf8ViewOk();
}
fn testUtf8ViewOk() !void {
@@ -450,7 +450,7 @@ fn testUtf8ViewOk() !void {
}
test "bad utf8 slice" {
- comptime try testBadUtf8Slice();
+ try comptime testBadUtf8Slice();
try testBadUtf8Slice();
}
fn testBadUtf8Slice() !void {
@@ -461,7 +461,7 @@ fn testBadUtf8Slice() !void {
}
test "valid utf8" {
- comptime try testValidUtf8();
+ try comptime testValidUtf8();
try testValidUtf8();
}
fn testValidUtf8() !void {
@@ -480,7 +480,7 @@ fn testValidUtf8() !void {
}
test "invalid utf8 continuation bytes" {
- comptime try testInvalidUtf8ContinuationBytes();
+ try comptime testInvalidUtf8ContinuationBytes();
try testInvalidUtf8ContinuationBytes();
}
fn testInvalidUtf8ContinuationBytes() !void {
@@ -512,7 +512,7 @@ fn testInvalidUtf8ContinuationBytes() !void {
}
test "overlong utf8 codepoint" {
- comptime try testOverlongUtf8Codepoint();
+ try comptime testOverlongUtf8Codepoint();
try testOverlongUtf8Codepoint();
}
fn testOverlongUtf8Codepoint() !void {
@@ -525,7 +525,7 @@ fn testOverlongUtf8Codepoint() !void {
}
test "misc invalid utf8" {
- comptime try testMiscInvalidUtf8();
+ try comptime testMiscInvalidUtf8();
try testMiscInvalidUtf8();
}
fn testMiscInvalidUtf8() !void {
@@ -540,7 +540,7 @@ fn testMiscInvalidUtf8() !void {
}
test "utf8 iterator peeking" {
- comptime try testUtf8Peeking();
+ try comptime testUtf8Peeking();
try testUtf8Peeking();
}
@@ -813,7 +813,7 @@ fn testCalcUtf16LeLen() !void {
test "calculate utf16 string length of given utf8 string in u16" {
try testCalcUtf16LeLen();
- comptime try testCalcUtf16LeLen();
+ try comptime testCalcUtf16LeLen();
}
/// Print the given `utf16le` string
@@ -919,7 +919,7 @@ fn testUtf8CountCodepoints() !void {
test "utf8 count codepoints" {
try testUtf8CountCodepoints();
- comptime try testUtf8CountCodepoints();
+ try comptime testUtf8CountCodepoints();
}
fn testUtf8ValidCodepoint() !void {
@@ -935,5 +935,5 @@ fn testUtf8ValidCodepoint() !void {
test "utf8 valid codepoint" {
try testUtf8ValidCodepoint();
- comptime try testUtf8ValidCodepoint();
+ try comptime testUtf8ValidCodepoint();
}