diff --git a/lib/std/Random/Isaac64.zig b/lib/std/Random/Isaac64.zig index cbf9df88033625be9b9f87c293988c3dac5981c6..624fad7f88797c0f74c37dec41b7646048afad84 100644 --- a/lib/std/Random/Isaac64.zig +++ b/lib/std/Random/Isaac64.zig @@ -201,7 +201,7 @@ test "sequence" { } } -test "fill" { +test fill { var r = Isaac64.init(0); // from reference implementation diff --git a/lib/std/Random/Pcg.zig b/lib/std/Random/Pcg.zig index a5f4ef7e412a598f3beb68eda58c4b91b08f1726..18d1ddcfec60be1ba635948ab414b8e3fda4f340 100644 --- a/lib/std/Random/Pcg.zig +++ b/lib/std/Random/Pcg.zig @@ -92,7 +92,7 @@ test "sequence" { } } -test "fill" { +test fill { var r = Pcg.init(0); const s0: u64 = 0x9394bf54ce5d79de; const s1: u64 = 0x84e9c579ef59bbf7; diff --git a/lib/std/Random/RomuTrio.zig b/lib/std/Random/RomuTrio.zig index 202361ae66220aefc6c6b807db7e3315c2eb7484..5b7664d7f2b6cd7844020c1cd045a77955a0bc1f 100644 --- a/lib/std/Random/RomuTrio.zig +++ b/lib/std/Random/RomuTrio.zig @@ -94,7 +94,7 @@ test "sequence" { } } -test "fill" { +test fill { // Unfortunately there does not seem to be an official test sequence. var r = RomuTrio.init(0); diff --git a/lib/std/Random/Sfc64.zig b/lib/std/Random/Sfc64.zig index 7a68446096b78e3a2ddd05148e2d41fe6f7a4cda..ebe618ddcf51ad66fde112477e2e895f3823b08c 100644 --- a/lib/std/Random/Sfc64.zig +++ b/lib/std/Random/Sfc64.zig @@ -98,7 +98,7 @@ test "sequence" { } } -test "fill" { +test fill { // Unfortunately there does not seem to be an official test sequence. var r = Sfc64.init(0); diff --git a/lib/std/Random/Xoroshiro128.zig b/lib/std/Random/Xoroshiro128.zig index 44eb594e374522ca6002fd75a86ed735d9ba3c75..37679069a9b8cc42e67fa4652062910efc402956 100644 --- a/lib/std/Random/Xoroshiro128.zig +++ b/lib/std/Random/Xoroshiro128.zig @@ -122,7 +122,7 @@ test "sequence" { } } -test "fill" { +test fill { var r = Xoroshiro128.init(0); r.s[0] = 0xaeecf86f7878dd75; r.s[1] = 0x01cd153642e72622; diff --git a/lib/std/Random/Xoshiro256.zig b/lib/std/Random/Xoshiro256.zig index 94e62b14803900743fc68e19cb760e30e8b4762e..fb65c2ba58e89b0bb50b22d1937ee8d359324e1c 100644 --- a/lib/std/Random/Xoshiro256.zig +++ b/lib/std/Random/Xoshiro256.zig @@ -122,7 +122,7 @@ test "sequence" { } } -test "fill" { +test fill { var r = Xoshiro256.init(0); const seq = [_]u64{ diff --git a/lib/std/SemanticVersion.zig b/lib/std/SemanticVersion.zig index 71529045e50c871ad79c4e0bf5e939601f7e009c..bde3e906d8e24d6efa7721655eed974150b3f6a5 100644 --- a/lib/std/SemanticVersion.zig +++ b/lib/std/SemanticVersion.zig @@ -166,7 +166,7 @@ pub fn format( const expect = std.testing.expect; const expectError = std.testing.expectError; -test "format" { +test format { // Many of these test strings are from https://github.com/semver/semver.org/issues/59#issuecomment-390854010. // Valid version strings should be accepted. diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index bf538c1b4f8090695cef066a64305ded6b08f446..a043f267bf0151236b8fee69d970b980d7293882 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -1437,7 +1437,7 @@ fn testIncrementNotify(value: *usize, event: *ResetEvent) void { event.set(); } -test "join" { +test join { if (builtin.single_threaded) return error.SkipZigTest; var value: usize = 0; @@ -1449,7 +1449,7 @@ test "join" { try std.testing.expectEqual(value, 1); } -test "detach" { +test detach { if (builtin.single_threaded) return error.SkipZigTest; var value: usize = 0; diff --git a/lib/std/Thread/Condition.zig b/lib/std/Thread/Condition.zig index 5c436261a8afa04ff1a9d6d3d6dd1ac72896143f..b1154f8bd091f1fac6fafca819111e1cb6c65dd0 100644 --- a/lib/std/Thread/Condition.zig +++ b/lib/std/Thread/Condition.zig @@ -362,7 +362,7 @@ test "wait and signal" { } } -test "signal" { +test signal { // This test requires spawning threads if (builtin.single_threaded) { return error.SkipZigTest; @@ -491,7 +491,7 @@ test "multi signal" { } } -test "broadcasting" { +test broadcast { // This test requires spawning threads if (builtin.single_threaded) { return error.SkipZigTest; diff --git a/lib/std/Thread/Semaphore.zig b/lib/std/Thread/Semaphore.zig index 47dccea6df8842833fed8584603a0471200f9531..a82ae3d002b1fb4f0147be5e2747958ad8b93dc2 100644 --- a/lib/std/Thread/Semaphore.zig +++ b/lib/std/Thread/Semaphore.zig @@ -71,7 +71,7 @@ pub fn post(sem: *Semaphore) void { sem.cond.signal(); } -test "Semaphore" { +test Semaphore { if (builtin.single_threaded) { return error.SkipZigTest; } @@ -97,7 +97,7 @@ test "Semaphore" { try testing.expect(n == num_threads); } -test "timedWait" { +test timedWait { var sem = Semaphore{}; try testing.expectEqual(0, sem.permits); diff --git a/lib/std/buf_set.zig b/lib/std/buf_set.zig index 6ff8ee23af58586890c1c0f1d8bc9cbd89c6fc6f..f027d57699a6a227f104081b7de6aae8582be4ed 100644 --- a/lib/std/buf_set.zig +++ b/lib/std/buf_set.zig @@ -90,6 +90,23 @@ pub const BufSet = struct { return self.cloneWithAllocator(self.allocator()); } + test clone { + var original = BufSet.init(testing.allocator); + defer original.deinit(); + try original.insert("x"); + + var cloned = try original.clone(); + defer cloned.deinit(); + cloned.remove("x"); + try testing.expect(original.count() == 1); + try testing.expect(cloned.count() == 0); + + try testing.expectError( + error.OutOfMemory, + original.cloneWithAllocator(testing.failing_allocator), + ); + } + fn free(self: *const BufSet, value: []const u8) void { self.hash_map.allocator.free(value); } @@ -115,23 +132,6 @@ test BufSet { try bufset.insert("z"); } -test "clone" { - var original = BufSet.init(testing.allocator); - defer original.deinit(); - try original.insert("x"); - - var cloned = try original.clone(); - defer cloned.deinit(); - cloned.remove("x"); - try testing.expect(original.count() == 1); - try testing.expect(cloned.count() == 0); - - try testing.expectError( - error.OutOfMemory, - original.cloneWithAllocator(testing.failing_allocator), - ); -} - test "clone with arena" { const allocator = std.testing.allocator; var arena = std.heap.ArenaAllocator.init(allocator); diff --git a/lib/std/compress/flate/CircularBuffer.zig b/lib/std/compress/flate/CircularBuffer.zig index bb98173aad334263768a66faa8f1a26ff898245e..066e0b4f39ee6bfd76a0f7e19d1c35b36e43d3b0 100644 --- a/lib/std/compress/flate/CircularBuffer.zig +++ b/lib/std/compress/flate/CircularBuffer.zig @@ -130,7 +130,7 @@ pub fn full(self: *Self) bool { } // example from: https://youtu.be/SJPvNi4HrWQ?t=3558 -test "writeMatch" { +test writeMatch { var cb: Self = .{}; cb.writeAll("a salad; "); @@ -150,7 +150,7 @@ test "writeMatch overlap" { try testing.expectEqualStrings("a b c b c b c d", cb.read()); } -test "readAtMost" { +test readAtMost { var cb: Self = .{}; cb.writeAll("0123456789"); @@ -165,7 +165,7 @@ test "readAtMost" { try testing.expectEqualStrings("", cb.read()); } -test "CircularBuffer" { +test Self { var cb: Self = .{}; const data = "0123456789abcdef" ** (1024 / 16); diff --git a/lib/std/compress/flate/Lookup.zig b/lib/std/compress/flate/Lookup.zig index 34ac38f5e8c9d9cb01632dce84b35e5ce13357f7..31f59550b06803ffefdb68484344a530669ecdfc 100644 --- a/lib/std/compress/flate/Lookup.zig +++ b/lib/std/compress/flate/Lookup.zig @@ -83,7 +83,7 @@ fn hashu(v: u32) u32 { return @intCast((v *% prime4) >> consts.lookup.shift); } -test "add/prev" { +test add { const data = [_]u8{ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, @@ -107,7 +107,7 @@ test "add/prev" { try expect(h.chain[2 + 8] == 2); } -test "bulkAdd" { +test bulkAdd { const data = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."; // one by one diff --git a/lib/std/compress/flate/SlidingWindow.zig b/lib/std/compress/flate/SlidingWindow.zig index 684b91bacc595d429e60776aa13bf1802a6d8c33..4a10383820b5627935a7d11b5a5d95750e60eec4 100644 --- a/lib/std/compress/flate/SlidingWindow.zig +++ b/lib/std/compress/flate/SlidingWindow.zig @@ -122,7 +122,7 @@ pub fn tokensBuffer(self: *Self) ?[]const u8 { return self.buffer[@intCast(self.fp)..self.rp]; } -test "match" { +test match { const data = "Blah blah blah blah blah!"; var win: Self = .{}; try expect(win.write(data) == data.len); @@ -142,7 +142,7 @@ test "match" { try expect(win.match(15, 20, 4) == 0); } -test "slide" { +test slide { var win: Self = .{}; win.wp = Self.buffer_len - 11; win.rp = Self.buffer_len - 111; diff --git a/lib/std/compress/flate/huffman_encoder.zig b/lib/std/compress/flate/huffman_encoder.zig index 067b5197d3e6fb8b6b73e2b7505115320cde64f8..c1c5148c97d5bf4a25cf587b1bc55793b33c57d6 100644 --- a/lib/std/compress/flate/huffman_encoder.zig +++ b/lib/std/compress/flate/huffman_encoder.zig @@ -458,7 +458,7 @@ fn bitReverse(comptime T: type, value: T, n: usize) T { return r >> @as(math.Log2Int(T), @intCast(@typeInfo(T).Int.bits - n)); } -test "bitReverse" { +test bitReverse { const ReverseBitsTest = struct { in: u16, bit_count: u5, diff --git a/lib/std/enums.zig b/lib/std/enums.zig index f992276431e1e07196b98172f46df0da8ba9c3ee..7247b5dc887259c569c226ae028f15af8eb3ee59 100644 --- a/lib/std/enums.zig +++ b/lib/std/enums.zig @@ -120,7 +120,7 @@ pub fn directEnumArray( return directEnumArrayDefault(E, Data, null, max_unused_slots, init_values); } -test "directEnumArray" { +test directEnumArray { const E = enum(i4) { a = 4, b = 6, c = 2 }; var runtime_false: bool = false; _ = &runtime_false; @@ -163,7 +163,7 @@ pub fn directEnumArrayDefault( return result; } -test "directEnumArrayDefault" { +test directEnumArrayDefault { const E = enum(i4) { a = 4, b = 6, c = 2 }; var runtime_false: bool = false; _ = &runtime_false; @@ -214,7 +214,7 @@ pub fn nameCast(comptime E: type, comptime value: anytype) E { }; } -test "nameCast" { +test nameCast { const A = enum(u1) { a = 0, b = 1 }; const B = enum(u1) { a = 1, b = 0 }; try testing.expectEqual(A.a, nameCast(A, .a)); @@ -515,7 +515,7 @@ pub fn BoundedEnumMultiset(comptime E: type, comptime CountSize: type) type { }; } -test "EnumMultiset" { +test EnumMultiset { const Ball = enum { red, green, blue }; const empty = EnumMultiset(Ball).initEmpty(); @@ -1298,7 +1298,7 @@ pub fn ensureIndexer(comptime T: type) void { } } -test "ensureIndexer" { +test ensureIndexer { ensureIndexer(struct { pub const Key = u32; pub const count: comptime_int = 8; @@ -1535,7 +1535,7 @@ test "EnumIndexer empty" { try testing.expectEqual(0, Indexer.count); } -test "enumValues" { +test values { const E = enum { X, Y, diff --git a/lib/std/math/acos.zig b/lib/std/math/acos.zig index 6adc00b4f725679433a131ad321359b1a2a46fcc..dfb3caf4d908aa0da3cf274c181cc99a5c7832a3 100644 --- a/lib/std/math/acos.zig +++ b/lib/std/math/acos.zig @@ -148,12 +148,12 @@ fn acos64(x: f64) f64 { return 2 * (df + w); } -test "acos" { +test acos { try expect(acos(@as(f32, 0.0)) == acos32(0.0)); try expect(acos(@as(f64, 0.0)) == acos64(0.0)); } -test "acos32" { +test acos32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, acos32(0.0), 1.570796, epsilon)); @@ -164,7 +164,7 @@ test "acos32" { try expect(math.approxEqAbs(f32, acos32(-0.2), 1.772154, epsilon)); } -test "acos64" { +test acos64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, acos64(0.0), 1.570796, epsilon)); diff --git a/lib/std/math/acosh.zig b/lib/std/math/acosh.zig index 7bc9c06fc27ac9052c01fdfdf625c839cb6516f7..8c86dbba4cf6fc22943dacc79dee401482cabfd1 100644 --- a/lib/std/math/acosh.zig +++ b/lib/std/math/acosh.zig @@ -59,12 +59,12 @@ fn acosh64(x: f64) f64 { } } -test "acosh" { +test acosh { try expect(acosh(@as(f32, 1.5)) == acosh32(1.5)); try expect(acosh(@as(f64, 1.5)) == acosh64(1.5)); } -test "acosh32" { +test acosh32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, acosh32(1.5), 0.962424, epsilon)); @@ -73,7 +73,7 @@ test "acosh32" { try expect(math.approxEqAbs(f32, acosh32(123123.234375), 12.414088, epsilon)); } -test "acosh64" { +test acosh64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, acosh64(1.5), 0.962424, epsilon)); diff --git a/lib/std/math/asin.zig b/lib/std/math/asin.zig index 885ab35b9bd0f3b86d268021d180d32515120151..cb4571c24e6d0471c8b945dcc807a0ce3e707a58 100644 --- a/lib/std/math/asin.zig +++ b/lib/std/math/asin.zig @@ -141,12 +141,12 @@ fn asin64(x: f64) f64 { } } -test "asin" { +test asin { try expect(asin(@as(f32, 0.0)) == asin32(0.0)); try expect(asin(@as(f64, 0.0)) == asin64(0.0)); } -test "asin32" { +test asin32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, asin32(0.0), 0.0, epsilon)); @@ -157,7 +157,7 @@ test "asin32" { try expect(math.approxEqAbs(f32, asin32(0.8923), 1.102415, epsilon)); } -test "asin64" { +test asin64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, asin64(0.0), 0.0, epsilon)); diff --git a/lib/std/math/asinh.zig b/lib/std/math/asinh.zig index 81e1abc7b80bce7ede7c6c97e146cfc61993e397..b2fd1b13a283e87d03fb311b7c750d1b6992db26 100644 --- a/lib/std/math/asinh.zig +++ b/lib/std/math/asinh.zig @@ -80,12 +80,12 @@ fn asinh64(x: f64) f64 { return if (s != 0) -rx else rx; } -test "asinh" { +test asinh { try expect(asinh(@as(f32, 0.0)) == asinh32(0.0)); try expect(asinh(@as(f64, 0.0)) == asinh64(0.0)); } -test "asinh32" { +test asinh32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, asinh32(0.0), 0.0, epsilon)); @@ -98,7 +98,7 @@ test "asinh32" { try expect(math.approxEqAbs(f32, asinh32(123123.234375), 12.414088, epsilon)); } -test "asinh64" { +test asinh64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, asinh64(0.0), 0.0, epsilon)); diff --git a/lib/std/math/atan.zig b/lib/std/math/atan.zig index b6cf2310c4edf59774945e0d5610501bf63e96d5..377d96897ff7acad0e76aece1866fdbc4fd31d4e 100644 --- a/lib/std/math/atan.zig +++ b/lib/std/math/atan.zig @@ -212,12 +212,12 @@ fn atan64(x_: f64) f64 { } } -test "atan" { +test atan { try expect(@as(u32, @bitCast(atan(@as(f32, 0.2)))) == @as(u32, @bitCast(atan32(0.2)))); try expect(atan(@as(f64, 0.2)) == atan64(0.2)); } -test "atan32" { +test atan32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, atan32(0.2), 0.197396, epsilon)); @@ -227,7 +227,7 @@ test "atan32" { try expect(math.approxEqAbs(f32, atan32(1.5), 0.982794, epsilon)); } -test "atan64" { +test atan64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, atan64(0.2), 0.197396, epsilon)); diff --git a/lib/std/math/atan2.zig b/lib/std/math/atan2.zig index 77ceff37d2dcc3b9327670993f7a5f5d2e8a7096..f0c8aa0792046a94b900fba216dde87724ec8e1c 100644 --- a/lib/std/math/atan2.zig +++ b/lib/std/math/atan2.zig @@ -214,7 +214,7 @@ fn atan2_64(y: f64, x: f64) f64 { } } -test "atan2" { +test atan2 { const y32: f32 = 0.2; const x32: f32 = 0.21; const y64: f64 = 0.2; @@ -223,7 +223,7 @@ test "atan2" { try expect(atan2(y64, x64) == atan2_64(0.2, 0.21)); } -test "atan2_32" { +test atan2_32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, atan2_32(0.0, 0.0), 0.0, epsilon)); @@ -235,7 +235,7 @@ test "atan2_32" { try expect(math.approxEqAbs(f32, atan2_32(0.34, 1.243), 0.267001, epsilon)); } -test "atan2_64" { +test atan2_64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, atan2_64(0.0, 0.0), 0.0, epsilon)); diff --git a/lib/std/math/atanh.zig b/lib/std/math/atanh.zig index 51051c5902b711763a4eb6e1f05b057913fa4087..4cca62a8e79564104bec8e0e9ce7b7aa9e882649 100644 --- a/lib/std/math/atanh.zig +++ b/lib/std/math/atanh.zig @@ -84,12 +84,12 @@ fn atanh_64(x: f64) f64 { return if (s != 0) -y else y; } -test "atanh" { +test atanh { try expect(atanh(@as(f32, 0.0)) == atanh_32(0.0)); try expect(atanh(@as(f64, 0.0)) == atanh_64(0.0)); } -test "atanh_32" { +test atanh_32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, atanh_32(0.0), 0.0, epsilon)); @@ -97,7 +97,7 @@ test "atanh_32" { try expect(math.approxEqAbs(f32, atanh_32(0.8923), 1.433099, epsilon)); } -test "atanh_64" { +test atanh_64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, atanh_64(0.0), 0.0, epsilon)); diff --git a/lib/std/math/big/rational.zig b/lib/std/math/big/rational.zig index 35df8f90187075a3764e78db6df2023d078766ae..774e0c1314a9f57598c75f232dd1be9cb9eda8da 100644 --- a/lib/std/math/big/rational.zig +++ b/lib/std/math/big/rational.zig @@ -493,7 +493,7 @@ fn extractLowBits(a: Int, comptime T: type) T { } } -test "extractLowBits" { +test extractLowBits { var a = try Int.initSet(testing.allocator, 0x11112222333344441234567887654321); defer a.deinit(); diff --git a/lib/std/math/cbrt.zig b/lib/std/math/cbrt.zig index 140b06f4e55e750d9348c906206e64033c3939b9..e1290fdd2b65a515359334667cd7357c9b895747 100644 --- a/lib/std/math/cbrt.zig +++ b/lib/std/math/cbrt.zig @@ -119,12 +119,12 @@ fn cbrt64(x: f64) f64 { return t + t * q; } -test "cbrt" { +test cbrt { try expect(cbrt(@as(f32, 0.0)) == cbrt32(0.0)); try expect(cbrt(@as(f64, 0.0)) == cbrt64(0.0)); } -test "cbrt32" { +test cbrt32 { const epsilon = 0.000001; try expect(math.isPositiveZero(cbrt32(0.0))); @@ -135,7 +135,7 @@ test "cbrt32" { try expect(math.approxEqAbs(f32, cbrt32(123123.234375), 49.748501, epsilon)); } -test "cbrt64" { +test cbrt64 { const epsilon = 0.000001; try expect(math.isPositiveZero(cbrt64(0.0))); diff --git a/lib/std/math/complex/atan.zig b/lib/std/math/complex/atan.zig index 77a1e5b8399b714cd45514cd0d47721f1bac0892..33109178f8db39999d6d69c12f23dea2497e46e9 100644 --- a/lib/std/math/complex/atan.zig +++ b/lib/std/math/complex/atan.zig @@ -120,7 +120,7 @@ fn atan64(z: Complex(f64)) Complex(f64) { const epsilon = 0.0001; -test "atan32" { +test atan32 { const a = Complex(f32).init(5, 3); const c = atan(a); @@ -128,7 +128,7 @@ test "atan32" { try testing.expect(math.approxEqAbs(f32, c.im, 0.086569, epsilon)); } -test "atan64" { +test atan64 { const a = Complex(f64).init(5, 3); const c = atan(a); diff --git a/lib/std/math/complex/atanh.zig b/lib/std/math/complex/atanh.zig index 4a246daa85f88d63cf02064ac0529fbf0a0e7d8f..54d21fc433537ca5848997f50674cf0e1d07a864 100644 --- a/lib/std/math/complex/atanh.zig +++ b/lib/std/math/complex/atanh.zig @@ -14,7 +14,7 @@ pub fn atanh(z: anytype) Complex(@TypeOf(z.re, z.im)) { const epsilon = 0.0001; -test "atanh" { +test atanh { const a = Complex(f32).init(5, 3); const c = atanh(a); diff --git a/lib/std/math/complex/conj.zig b/lib/std/math/complex/conj.zig index 596bf2a296aa0225fccc4a5fff4d2b1db6c84c6d..b5a4d063d3170956900ec7cedc5bb2b068f22b6e 100644 --- a/lib/std/math/complex/conj.zig +++ b/lib/std/math/complex/conj.zig @@ -10,7 +10,7 @@ pub fn conj(z: anytype) Complex(@TypeOf(z.re, z.im)) { return Complex(T).init(z.re, -z.im); } -test "onj" { +test conj { const a = Complex(f32).init(5, 3); const c = a.conjugate(); diff --git a/lib/std/math/complex/cos.zig b/lib/std/math/complex/cos.zig index 85ab07bf4b4a018cd9dbd32a76cf43813b0596f1..389dd013e3a060a512cccfcf92a5c5e48e8eddbf 100644 --- a/lib/std/math/complex/cos.zig +++ b/lib/std/math/complex/cos.zig @@ -13,7 +13,7 @@ pub fn cos(z: anytype) Complex(@TypeOf(z.re, z.im)) { const epsilon = 0.0001; -test "cos" { +test cos { const a = Complex(f32).init(5, 3); const c = cos(a); diff --git a/lib/std/math/complex/cosh.zig b/lib/std/math/complex/cosh.zig index ffaff9932aa0017bd031584e80dce264ad761598..42f5b432ec0c4a96780ed83415861b2e994efee9 100644 --- a/lib/std/math/complex/cosh.zig +++ b/lib/std/math/complex/cosh.zig @@ -155,7 +155,7 @@ fn cosh64(z: Complex(f64)) Complex(f64) { const epsilon = 0.0001; -test "cosh32" { +test cosh32 { const a = Complex(f32).init(5, 3); const c = cosh(a); @@ -163,7 +163,7 @@ test "cosh32" { try testing.expect(math.approxEqAbs(f32, c.im, 10.471557, epsilon)); } -test "cosh64" { +test cosh64 { const a = Complex(f64).init(5, 3); const c = cosh(a); diff --git a/lib/std/math/complex/exp.zig b/lib/std/math/complex/exp.zig index 457bddc1e2f43498d8b040250754bfd0f5d9860b..a3916300c4b76ce29090d9aa83c5be86e0b45601 100644 --- a/lib/std/math/complex/exp.zig +++ b/lib/std/math/complex/exp.zig @@ -119,7 +119,7 @@ fn exp64(z: Complex(f64)) Complex(f64) { } } -test "exp32" { +test exp32 { const tolerance_f32 = @sqrt(math.floatEps(f32)); { @@ -139,7 +139,7 @@ test "exp32" { } } -test "exp64" { +test exp64 { const tolerance_f64 = @sqrt(math.floatEps(f64)); { diff --git a/lib/std/math/complex/log.zig b/lib/std/math/complex/log.zig index 12329380bd6a9823093ea098c1c6d067f13cf154..65859c2dce93c2d461f80b2b9048776657947ae8 100644 --- a/lib/std/math/complex/log.zig +++ b/lib/std/math/complex/log.zig @@ -15,7 +15,7 @@ pub fn log(z: anytype) Complex(@TypeOf(z.re, z.im)) { const epsilon = 0.0001; -test "log" { +test log { const a = Complex(f32).init(5, 3); const c = log(a); diff --git a/lib/std/math/complex/pow.zig b/lib/std/math/complex/pow.zig index d675f5673948fd8718e0a88c406b2a2fda1e14d0..874e4037dcb7a76cda90d9cb5bf8a23a6d008ec3 100644 --- a/lib/std/math/complex/pow.zig +++ b/lib/std/math/complex/pow.zig @@ -11,7 +11,7 @@ pub fn pow(z: anytype, s: anytype) Complex(@TypeOf(z.re, z.im, s.re, s.im)) { const epsilon = 0.0001; -test "pow" { +test pow { const a = Complex(f32).init(5, 3); const b = Complex(f32).init(2.3, -1.3); const c = pow(a, b); diff --git a/lib/std/math/complex/proj.zig b/lib/std/math/complex/proj.zig index 7026977b362c52166eeac9c2d4ea694580d3c3b5..b7d3d58b12cb9cf0d54ba8c0b858c9f22c802a3d 100644 --- a/lib/std/math/complex/proj.zig +++ b/lib/std/math/complex/proj.zig @@ -15,9 +15,7 @@ pub fn proj(z: anytype) Complex(@TypeOf(z.re, z.im)) { return Complex(T).init(z.re, z.im); } -const epsilon = 0.0001; - -test "proj" { +test proj { const a = Complex(f32).init(5, 3); const c = proj(a); diff --git a/lib/std/math/complex/sin.zig b/lib/std/math/complex/sin.zig index 4ea4ca5be134505d279024cdb98066090028902b..3ca2419e430d552f0d916d447d7d0f082c3bbfd1 100644 --- a/lib/std/math/complex/sin.zig +++ b/lib/std/math/complex/sin.zig @@ -14,7 +14,7 @@ pub fn sin(z: anytype) Complex(@TypeOf(z.re, z.im)) { const epsilon = 0.0001; -test "sin" { +test sin { const a = Complex(f32).init(5, 3); const c = sin(a); diff --git a/lib/std/math/complex/sinh.zig b/lib/std/math/complex/sinh.zig index c8fce46947d0a8c4c3fabcd59953ca52c2d95c1c..911587a9c5320970e5b4c259aec639c5885b2d51 100644 --- a/lib/std/math/complex/sinh.zig +++ b/lib/std/math/complex/sinh.zig @@ -154,7 +154,7 @@ fn sinh64(z: Complex(f64)) Complex(f64) { const epsilon = 0.0001; -test "sinh32" { +test sinh32 { const a = Complex(f32).init(5, 3); const c = sinh(a); @@ -162,7 +162,7 @@ test "sinh32" { try testing.expect(math.approxEqAbs(f32, c.im, 10.472508, epsilon)); } -test "sinh64" { +test sinh64 { const a = Complex(f64).init(5, 3); const c = sinh(a); diff --git a/lib/std/math/complex/sqrt.zig b/lib/std/math/complex/sqrt.zig index 6a1f9d21c736d5058da1ff1364f21e1f4462e972..0edf18fb2378540820b5a77745bb816268be19fe 100644 --- a/lib/std/math/complex/sqrt.zig +++ b/lib/std/math/complex/sqrt.zig @@ -129,7 +129,7 @@ fn sqrt64(z: Complex(f64)) Complex(f64) { const epsilon = 0.0001; -test "sqrt32" { +test sqrt32 { const a = Complex(f32).init(5, 3); const c = sqrt(a); @@ -137,7 +137,7 @@ test "sqrt32" { try testing.expect(math.approxEqAbs(f32, c.im, 0.644574, epsilon)); } -test "sqrt64" { +test sqrt64 { const a = Complex(f64).init(5, 3); const c = sqrt(a); diff --git a/lib/std/math/complex/tan.zig b/lib/std/math/complex/tan.zig index de7f3404500d5b44eec3a0b688a04da20d74f3b8..ad5b1b47b6488ce5efec992e13e310ef16d821e2 100644 --- a/lib/std/math/complex/tan.zig +++ b/lib/std/math/complex/tan.zig @@ -14,7 +14,7 @@ pub fn tan(z: anytype) Complex(@TypeOf(z.re, z.im)) { const epsilon = 0.0001; -test "tan" { +test tan { const a = Complex(f32).init(5, 3); const c = tan(a); diff --git a/lib/std/math/complex/tanh.zig b/lib/std/math/complex/tanh.zig index 554b83f46f5c2c8a4c9b7f2b482a4d7f0da74596..8a1d46eca7537af1d1f4cac947063a0f7ea1a00d 100644 --- a/lib/std/math/complex/tanh.zig +++ b/lib/std/math/complex/tanh.zig @@ -103,7 +103,7 @@ fn tanh64(z: Complex(f64)) Complex(f64) { const epsilon = 0.0001; -test "tanh32" { +test tanh32 { const a = Complex(f32).init(5, 3); const c = tanh(a); @@ -111,7 +111,7 @@ test "tanh32" { try testing.expect(math.approxEqAbs(f32, c.im, -0.000025, epsilon)); } -test "tanh64" { +test tanh64 { const a = Complex(f64).init(5, 3); const c = tanh(a); diff --git a/lib/std/math/cosh.zig b/lib/std/math/cosh.zig index 8b46081de172b58e705805923dfed6edd160f70b..950448bb7492e2ca438d8e7cdd9f20fc2b768d69 100644 --- a/lib/std/math/cosh.zig +++ b/lib/std/math/cosh.zig @@ -86,12 +86,12 @@ fn cosh64(x: f64) f64 { return expo2(ax); } -test "cosh" { +test cosh { try expect(cosh(@as(f32, 1.5)) == cosh32(1.5)); try expect(cosh(@as(f64, 1.5)) == cosh64(1.5)); } -test "cosh32" { +test cosh32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, cosh32(0.0), 1.0, epsilon)); @@ -104,7 +104,7 @@ test "cosh32" { try expect(math.approxEqAbs(f32, cosh32(-1.5), 2.352410, epsilon)); } -test "cosh64" { +test cosh64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, cosh64(0.0), 1.0, epsilon)); diff --git a/lib/std/math/expm1.zig b/lib/std/math/expm1.zig index 81ffe16bd7ce62d6336d0ea1b6c0e5b2d81ca4e8..c64a123631fefc0cae4e6b71dd752e05412cb3f6 100644 --- a/lib/std/math/expm1.zig +++ b/lib/std/math/expm1.zig @@ -286,12 +286,12 @@ fn expm1_64(x_: f64) f64 { } } -test "exp1m" { +test expm1 { try expect(expm1(@as(f32, 0.0)) == expm1_32(0.0)); try expect(expm1(@as(f64, 0.0)) == expm1_64(0.0)); } -test "expm1_32" { +test expm1_32 { const epsilon = 0.000001; try expect(math.isPositiveZero(expm1_32(0.0))); @@ -301,7 +301,7 @@ test "expm1_32" { try expect(math.approxEqAbs(f32, expm1_32(1.5), 3.481689, epsilon)); } -test "expm1_64" { +test expm1_64 { const epsilon = 0.000001; try expect(math.isPositiveZero(expm1_64(0.0))); diff --git a/lib/std/math/float.zig b/lib/std/math/float.zig index bd510baefad4a37b56343401a6207e099f490142..f8f04e217cb393a7a6029df23a8851d054a6e697 100644 --- a/lib/std/math/float.zig +++ b/lib/std/math/float.zig @@ -132,7 +132,7 @@ test "float bits" { } } -test "inf" { +test inf { const inf_u16: u16 = 0x7C00; const inf_u32: u32 = 0x7F800000; const inf_u64: u64 = 0x7FF0000000000000; @@ -145,7 +145,7 @@ test "inf" { try expectEqual(inf_u128, @as(u128, @bitCast(inf(f128)))); } -test "nan" { +test nan { const qnan_u16: u16 = 0x7E00; const qnan_u32: u32 = 0x7FC00000; const qnan_u64: u64 = 0x7FF8000000000000; @@ -158,7 +158,7 @@ test "nan" { try expectEqual(qnan_u128, @as(u128, @bitCast(nan(f128)))); } -test "snan" { +test snan { // TODO: https://github.com/ziglang/zig/issues/14366 if (builtin.zig_backend == .stage2_llvm and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest; diff --git a/lib/std/math/gamma.zig b/lib/std/math/gamma.zig index 15967f1afae0026439fe0efa796c91ec578a90ed..ce37db496215aeb1ea75867a9a948a3ba4936f39 100644 --- a/lib/std/math/gamma.zig +++ b/lib/std/math/gamma.zig @@ -240,7 +240,7 @@ const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; const expectApproxEqRel = std.testing.expectApproxEqRel; -test "gamma" { +test gamma { inline for (&.{ f32, f64 }) |T| { const eps = @sqrt(std.math.floatEps(T)); try expectApproxEqRel(@as(T, 120), gamma(T, 6), eps); @@ -286,7 +286,7 @@ test "gamma.special" { } } -test "lgamma" { +test lgamma { inline for (&.{ f32, f64 }) |T| { const eps = @sqrt(std.math.floatEps(T)); try expectApproxEqRel(@as(T, @log(24.0)), lgamma(T, 5), eps); diff --git a/lib/std/math/hypot.zig b/lib/std/math/hypot.zig index 92e0c1eb13705f9037cba4f0ef75819ecfbf2e33..c0bfabca1cb7b28c5241dcabf982c2c06473046a 100644 --- a/lib/std/math/hypot.zig +++ b/lib/std/math/hypot.zig @@ -124,7 +124,7 @@ fn hypot64(x: f64, y: f64) f64 { return z * @sqrt(ly + lx + hy + hx); } -test "hypot" { +test hypot { const x32: f32 = 0.0; const y32: f32 = -1.2; const x64: f64 = 0.0; @@ -133,7 +133,7 @@ test "hypot" { try expect(hypot(x64, y64) == hypot64(0.0, -1.2)); } -test "hypot32" { +test hypot32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, hypot32(0.0, -1.2), 1.2, epsilon)); @@ -145,7 +145,7 @@ test "hypot32" { try expect(math.approxEqAbs(f32, hypot32(123123.234375, 529428.707813), 543556.875, epsilon)); } -test "hypot64" { +test hypot64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, hypot64(0.0, -1.2), 1.2, epsilon)); diff --git a/lib/std/math/log1p.zig b/lib/std/math/log1p.zig index 48a57366b7542874977c204a2a9813a313c9c6a5..2d7507bc88fbfbc37b915580f06bbd7ed737ce10 100644 --- a/lib/std/math/log1p.zig +++ b/lib/std/math/log1p.zig @@ -182,12 +182,12 @@ fn log1p_64(x: f64) f64 { return s * (hfsq + R) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi; } -test "log1p" { +test log1p { try expect(log1p(@as(f32, 0.0)) == log1p_32(0.0)); try expect(log1p(@as(f64, 0.0)) == log1p_64(0.0)); } -test "log1p_32" { +test log1p_32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, log1p_32(0.0), 0.0, epsilon)); @@ -199,7 +199,7 @@ test "log1p_32" { try expect(math.approxEqAbs(f32, log1p_32(123123.234375), 11.720949, epsilon)); } -test "log1p_64" { +test log1p_64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, log1p_64(0.0), 0.0, epsilon)); diff --git a/lib/std/math/log2.zig b/lib/std/math/log2.zig index 65fd9c296bea6d943e1036009b9704f968ff9031..0902f3e10c7c6bd7f2ecd6aafa3d32d6a2e8bb55 100644 --- a/lib/std/math/log2.zig +++ b/lib/std/math/log2.zig @@ -42,7 +42,7 @@ pub fn log2(x: anytype) @TypeOf(x) { } } -test "log2" { +test log2 { // https://github.com/ziglang/zig/issues/13703 if (builtin.cpu.arch == .aarch64 and builtin.os.tag == .windows) return error.SkipZigTest; diff --git a/lib/std/math/modf.zig b/lib/std/math/modf.zig index cb539136e4f61946e0bb549279b81a1003a4eb45..03b8111873a5906699caaefc22b35c84e4c75765 100644 --- a/lib/std/math/modf.zig +++ b/lib/std/math/modf.zig @@ -123,14 +123,14 @@ fn modf64(x: f64) modf64_result { return result; } -test "modf" { +test modf { const a = modf(@as(f32, 1.0)); const b = modf32(1.0); // NOTE: No struct comparison on generic return type function? non-named, makes sense, but still. try expectEqual(a, b); } -test "modf32" { +test modf32 { const epsilon = 0.000001; var r: modf32_result = undefined; @@ -155,7 +155,7 @@ test "modf32" { try expect(math.approxEqAbs(f32, r.fpart, 0.340820, epsilon)); } -test "modf64" { +test modf64 { const epsilon = 0.000001; var r: modf64_result = undefined; diff --git a/lib/std/math/powi.zig b/lib/std/math/powi.zig index 85ed538d348d519c7265ba42e56c1f7f959efb3b..271d24352ad7506b19e862f88ed3c9c8609a62b3 100644 --- a/lib/std/math/powi.zig +++ b/lib/std/math/powi.zig @@ -91,7 +91,7 @@ pub fn powi(comptime T: type, x: T, y: T) (error{ return acc; } -test "powi" { +test powi { try testing.expectError(error.Overflow, powi(i8, -66, 6)); try testing.expectError(error.Overflow, powi(i16, -13, 13)); try testing.expectError(error.Overflow, powi(i32, -32, 21)); diff --git a/lib/std/math/sinh.zig b/lib/std/math/sinh.zig index a5cb8bc2dab6143db52b7df9eed95f8f409faaa6..5652603d1a8452dd6512044d1de40ea11bf36ac2 100644 --- a/lib/std/math/sinh.zig +++ b/lib/std/math/sinh.zig @@ -91,12 +91,12 @@ fn sinh64(x: f64) f64 { return 2 * h * expo2(ax); } -test "sinh" { +test sinh { try expect(sinh(@as(f32, 1.5)) == sinh32(1.5)); try expect(sinh(@as(f64, 1.5)) == sinh64(1.5)); } -test "sinh32" { +test sinh32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, sinh32(0.0), 0.0, epsilon)); @@ -109,7 +109,7 @@ test "sinh32" { try expect(math.approxEqAbs(f32, sinh32(-1.5), -2.129279, epsilon)); } -test "sinh64" { +test sinh64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, sinh64(0.0), 0.0, epsilon)); diff --git a/lib/std/math/tanh.zig b/lib/std/math/tanh.zig index c32a60957b5f9f7354ba63e2217b5bf651e0fabd..dfe70f4b7a2ec7f6fe94db22466de56a3f3800af 100644 --- a/lib/std/math/tanh.zig +++ b/lib/std/math/tanh.zig @@ -104,12 +104,12 @@ fn tanh64(x: f64) f64 { return if (sign) -t else t; } -test "tanh" { +test tanh { try expect(tanh(@as(f32, 1.5)) == tanh32(1.5)); try expect(tanh(@as(f64, 1.5)) == tanh64(1.5)); } -test "tanh32" { +test tanh32 { const epsilon = 0.000001; try expect(math.approxEqAbs(f32, tanh32(0.0), 0.0, epsilon)); @@ -122,7 +122,7 @@ test "tanh32" { try expect(math.approxEqAbs(f32, tanh32(-37.45), -1.0, epsilon)); } -test "tanh64" { +test tanh64 { const epsilon = 0.000001; try expect(math.approxEqAbs(f64, tanh64(0.0), 0.0, epsilon)); diff --git a/lib/std/meta.zig b/lib/std/meta.zig index 80e987478270efe00efe479f6a484304fc42e3e8..66388aebf68db6fd3d916d3fa3f43cc82accb97a 100644 --- a/lib/std/meta.zig +++ b/lib/std/meta.zig @@ -46,7 +46,7 @@ pub fn stringToEnum(comptime T: type, str: []const u8) ?T { } } -test "stringToEnum" { +test stringToEnum { const E1 = enum { A, B, @@ -73,7 +73,7 @@ pub fn alignment(comptime T: type) comptime_int { }; } -test "alignment" { +test alignment { try testing.expect(alignment(u8) == 1); try testing.expect(alignment(*align(1) u8) == 1); try testing.expect(alignment(*align(2) u8) == 2); @@ -94,7 +94,7 @@ pub fn Child(comptime T: type) type { }; } -test "Child" { +test Child { try testing.expect(Child([1]u8) == u8); try testing.expect(Child(*u8) == u8); try testing.expect(Child([]u8) == u8); @@ -121,7 +121,7 @@ pub fn Elem(comptime T: type) type { @compileError("Expected pointer, slice, array or vector type, found '" ++ @typeName(T) ++ "'"); } -test "Elem" { +test Elem { try testing.expect(Elem([1]u8) == u8); try testing.expect(Elem([*]u8) == u8); try testing.expect(Elem([]u8) == u8); @@ -255,7 +255,7 @@ pub fn containerLayout(comptime T: type) Type.ContainerLayout { }; } -test "containerLayout" { +test containerLayout { const S1 = struct {}; const S2 = packed struct {}; const S3 = extern struct {}; @@ -289,7 +289,7 @@ pub fn declarations(comptime T: type) []const Type.Declaration { }; } -test "declarations" { +test declarations { const E1 = enum { A, @@ -329,7 +329,7 @@ pub fn declarationInfo(comptime T: type, comptime decl_name: []const u8) Type.De @compileError("'" ++ @typeName(T) ++ "' has no declaration '" ++ decl_name ++ "'"); } -test "declarationInfo" { +test declarationInfo { const E1 = enum { A, @@ -370,7 +370,7 @@ pub fn fields(comptime T: type) switch (@typeInfo(T)) { }; } -test "fields" { +test fields { const E1 = enum { A, }; @@ -409,7 +409,7 @@ pub fn fieldInfo(comptime T: type, comptime field: FieldEnum(T)) switch (@typeIn return fields(T)[@intFromEnum(field)]; } -test "fieldInfo" { +test fieldInfo { const E1 = enum { A, }; @@ -442,7 +442,7 @@ pub fn FieldType(comptime T: type, comptime field: FieldEnum(T)) type { return fieldInfo(T, field).type; } -test "FieldType" { +test FieldType { const S = struct { a: u8, b: u16, @@ -470,7 +470,7 @@ pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 { }; } -test "fieldNames" { +test fieldNames { const E1 = enum { A, B }; const E2 = error{A}; const S1 = struct { @@ -511,7 +511,7 @@ pub fn tags(comptime T: type) *const [fields(T).len]T { }; } -test "tags" { +test tags { const E1 = enum { A, B }; const E2 = error{A}; @@ -604,7 +604,7 @@ fn expectEqualEnum(expected: anytype, actual: @TypeOf(expected)) !void { ); } -test "FieldEnum" { +test FieldEnum { try expectEqualEnum(enum {}, FieldEnum(struct {})); try expectEqualEnum(enum { a }, FieldEnum(struct { a: u8 })); try expectEqualEnum(enum { a, b, c }, FieldEnum(struct { a: u8, b: void, c: f32 })); @@ -639,7 +639,7 @@ pub fn DeclEnum(comptime T: type) type { }); } -test "DeclEnum" { +test DeclEnum { const A = struct { pub const a: u8 = 0; }; @@ -670,7 +670,7 @@ pub fn Tag(comptime T: type) type { }; } -test "Tag" { +test Tag { const E = enum(u8) { C = 33, D, @@ -690,7 +690,7 @@ pub fn activeTag(u: anytype) Tag(@TypeOf(u)) { return @as(Tag(T), u); } -test "activeTag" { +test activeTag { const UE = enum { Int, Float, @@ -727,7 +727,7 @@ pub fn TagPayload(comptime U: type, comptime tag: Tag(U)) type { return TagPayloadByName(U, @tagName(tag)); } -test "TagPayload" { +test TagPayload { const Event = union(enum) { Moved: struct { from: i32, @@ -802,7 +802,7 @@ pub fn eql(a: anytype, b: @TypeOf(a)) bool { } } -test "eql" { +test eql { const S = struct { a: u32, b: f64, @@ -863,7 +863,7 @@ test "eql" { try testing.expect(!eql(v1, v3)); } -test "intToEnum with error return" { +test intToEnum { const E1 = enum { A, }; @@ -965,7 +965,7 @@ pub fn Float(comptime bit_count: u8) type { }); } -test "Float" { +test Float { try testing.expectEqual(f16, Float(16)); try testing.expectEqual(f32, Float(32)); try testing.expectEqual(f64, Float(64)); @@ -1057,7 +1057,7 @@ const TupleTester = struct { } }; -test "ArgsTuple" { +test ArgsTuple { TupleTester.assertTuple(.{}, ArgsTuple(fn () void)); TupleTester.assertTuple(.{u32}, ArgsTuple(fn (a: u32) []const u8)); TupleTester.assertTuple(.{ u32, f16 }, ArgsTuple(fn (a: u32, b: f16) noreturn)); @@ -1065,7 +1065,7 @@ test "ArgsTuple" { TupleTester.assertTuple(.{u32}, ArgsTuple(fn (comptime a: u32) []const u8)); } -test "Tuple" { +test Tuple { TupleTester.assertTuple(.{}, Tuple(&[_]type{})); TupleTester.assertTuple(.{u32}, Tuple(&[_]type{u32})); TupleTester.assertTuple(.{ u32, f16 }, Tuple(&[_]type{ u32, f16 })); @@ -1103,7 +1103,7 @@ pub fn isError(error_union: anytype) bool { return if (error_union) |_| false else |_| true; } -test "isError" { +test isError { try std.testing.expect(isError(math.divTrunc(u8, 5, 0))); try std.testing.expect(!isError(math.divTrunc(u8, 5, 5))); } @@ -1121,7 +1121,7 @@ pub inline fn hasFn(comptime T: type, comptime name: []const u8) bool { return @typeInfo(@TypeOf(@field(T, name))) == .Fn; } -test "hasFn" { +test hasFn { const S1 = struct { pub fn foo() void {} }; @@ -1149,7 +1149,7 @@ pub inline fn hasMethod(comptime T: type, comptime name: []const u8) bool { }; } -test "hasMethod" { +test hasMethod { try std.testing.expect(!hasMethod(u32, "foo")); try std.testing.expect(!hasMethod([]u32, "len")); try std.testing.expect(!hasMethod(struct { u32, u64 }, "len")); @@ -1218,7 +1218,7 @@ pub inline fn hasUniqueRepresentation(comptime T: type) bool { }; } -test "hasUniqueRepresentation" { +test hasUniqueRepresentation { const TestStruct1 = struct { a: u32, b: u32,