authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2024-02-25 23:31:53-08:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2024-02-26 15:18:31-08:00
log16b3d1004ee520341839305826fe065eb5d8c818
treeeac514666f5f49e2d77b3aa82efaac901151bbee
parent1b79a42da096fcdeac22b56f17f82b0c7ec22a9b

Remove redundant test name prefixes now that test names are fully qualified

Follow up to #19079, which made test names fully qualified. This fixes tests that now-redundant information in their test names. For example here's a fully qualified test name before the changes in this commit: "priority_queue.test.std.PriorityQueue: shrinkAndFree" and the same test's name after the changes in this commit: "priority_queue.test.shrinkAndFree"

115 files changed, 757 insertions(+), 754 deletions(-)

lib/std/Random/Isaac64.zig+2-2
......@@ -173,7 +173,7 @@ pub fn fill(self: *Isaac64, buf: []u8) void {
173173 }
174174}
175175
176test "isaac64 sequence" {
176test "sequence" {
177177 var r = Isaac64.init(0);
178178
179179 // from reference implementation
......@@ -201,7 +201,7 @@ test "isaac64 sequence" {
201201 }
202202}
203203
204test "isaac64 fill" {
204test "fill" {
205205 var r = Isaac64.init(0);
206206
207207 // from reference implementation
lib/std/Random/Pcg.zig+2-2
......@@ -72,7 +72,7 @@ pub fn fill(self: *Pcg, buf: []u8) void {
7272 }
7373}
7474
75test "pcg sequence" {
75test "sequence" {
7676 var r = Pcg.init(0);
7777 const s0: u64 = 0x9394bf54ce5d79de;
7878 const s1: u64 = 0x84e9c579ef59bbf7;
......@@ -92,7 +92,7 @@ test "pcg sequence" {
9292 }
9393}
9494
95test "pcg fill" {
95test "fill" {
9696 var r = Pcg.init(0);
9797 const s0: u64 = 0x9394bf54ce5d79de;
9898 const s1: u64 = 0x84e9c579ef59bbf7;
lib/std/Random/RomuTrio.zig+3-3
......@@ -72,7 +72,7 @@ pub fn fill(self: *RomuTrio, buf: []u8) void {
7272 }
7373}
7474
75test "RomuTrio sequence" {
75test "sequence" {
7676 // Unfortunately there does not seem to be an official test sequence.
7777 var r = RomuTrio.init(0);
7878
......@@ -94,7 +94,7 @@ test "RomuTrio sequence" {
9494 }
9595}
9696
97test "RomuTrio fill" {
97test "fill" {
9898 // Unfortunately there does not seem to be an official test sequence.
9999 var r = RomuTrio.init(0);
100100
......@@ -120,7 +120,7 @@ test "RomuTrio fill" {
120120 }
121121}
122122
123test "RomuTrio buf seeding test" {
123test "buf seeding test" {
124124 const buf0 = @as([24]u8, @bitCast([3]u64{ 16294208416658607535, 13964609475759908645, 4703697494102998476 }));
125125 const resulting_state = .{ .x = 16294208416658607535, .y = 13964609475759908645, .z = 4703697494102998476 };
126126 var r = RomuTrio.init(0);
lib/std/Random/Sfc64.zig+2-2
......@@ -70,7 +70,7 @@ pub fn fill(self: *Sfc64, buf: []u8) void {
7070 }
7171}
7272
73test "Sfc64 sequence" {
73test "sequence" {
7474 // Unfortunately there does not seem to be an official test sequence.
7575 var r = Sfc64.init(0);
7676
......@@ -98,7 +98,7 @@ test "Sfc64 sequence" {
9898 }
9999}
100100
101test "Sfc64 fill" {
101test "fill" {
102102 // Unfortunately there does not seem to be an official test sequence.
103103 var r = Sfc64.init(0);
104104
lib/std/Random/Xoroshiro128.zig+2-2
......@@ -88,7 +88,7 @@ pub fn fill(self: *Xoroshiro128, buf: []u8) void {
8888 }
8989}
9090
91test "xoroshiro sequence" {
91test "sequence" {
9292 var r = Xoroshiro128.init(0);
9393 r.s[0] = 0xaeecf86f7878dd75;
9494 r.s[1] = 0x01cd153642e72622;
......@@ -122,7 +122,7 @@ test "xoroshiro sequence" {
122122 }
123123}
124124
125test "xoroshiro fill" {
125test "fill" {
126126 var r = Xoroshiro128.init(0);
127127 r.s[0] = 0xaeecf86f7878dd75;
128128 r.s[1] = 0x01cd153642e72622;
lib/std/Random/Xoshiro256.zig+2-2
......@@ -88,7 +88,7 @@ pub fn fill(self: *Xoshiro256, buf: []u8) void {
8888 }
8989}
9090
91test "xoroshiro sequence" {
91test "sequence" {
9292 if (@import("builtin").zig_backend == .stage2_c) return error.SkipZigTest;
9393
9494 var r = Xoshiro256.init(0);
......@@ -122,7 +122,7 @@ test "xoroshiro sequence" {
122122 }
123123}
124124
125test "xoroshiro fill" {
125test "fill" {
126126 var r = Xoshiro256.init(0);
127127
128128 const seq = [_]u64{
lib/std/SemanticVersion.zig+2-2
......@@ -166,7 +166,7 @@ pub fn format(
166166const expect = std.testing.expect;
167167const expectError = std.testing.expectError;
168168
169test "SemanticVersion format" {
169test "format" {
170170 // Many of these test strings are from https://github.com/semver/semver.org/issues/59#issuecomment-390854010.
171171
172172 // Valid version strings should be accepted.
......@@ -277,7 +277,7 @@ test "SemanticVersion format" {
277277 if (parse(big_invalid)) |ver| std.debug.panic("expected error, found {}", .{ver}) else |_| {}
278278}
279279
280test "SemanticVersion precedence" {
280test "precedence" {
281281 // SemVer 2 spec 11.2 example: 1.0.0 < 2.0.0 < 2.1.0 < 2.1.1.
282282 try expect(order(try parse("1.0.0"), try parse("2.0.0")) == .lt);
283283 try expect(order(try parse("2.0.0"), try parse("2.1.0")) == .lt);
lib/std/Thread.zig+2-2
......@@ -1437,7 +1437,7 @@ fn testIncrementNotify(value: *usize, event: *ResetEvent) void {
14371437 event.set();
14381438}
14391439
1440test "Thread.join" {
1440test "join" {
14411441 if (builtin.single_threaded) return error.SkipZigTest;
14421442
14431443 var value: usize = 0;
......@@ -1449,7 +1449,7 @@ test "Thread.join" {
14491449 try std.testing.expectEqual(value, 1);
14501450}
14511451
1452test "Thread.detach" {
1452test "detach" {
14531453 if (builtin.single_threaded) return error.SkipZigTest;
14541454
14551455 var value: usize = 0;
lib/std/Thread/Condition.zig+6-6
......@@ -296,7 +296,7 @@ const FutexImpl = struct {
296296 }
297297};
298298
299test "Condition - smoke test" {
299test "smoke test" {
300300 var mutex = Mutex{};
301301 var cond = Condition{};
302302
......@@ -317,7 +317,7 @@ test "Condition - smoke test" {
317317}
318318
319319// Inspired from: https://github.com/Amanieu/parking_lot/pull/129
320test "Condition - wait and signal" {
320test "wait and signal" {
321321 // This test requires spawning threads
322322 if (builtin.single_threaded) {
323323 return error.SkipZigTest;
......@@ -362,7 +362,7 @@ test "Condition - wait and signal" {
362362 }
363363}
364364
365test "Condition - signal" {
365test "signal" {
366366 // This test requires spawning threads
367367 if (builtin.single_threaded) {
368368 return error.SkipZigTest;
......@@ -429,7 +429,7 @@ test "Condition - signal" {
429429 }
430430}
431431
432test "Condition - multi signal" {
432test "multi signal" {
433433 // This test requires spawning threads
434434 if (builtin.single_threaded) {
435435 return error.SkipZigTest;
......@@ -491,7 +491,7 @@ test "Condition - multi signal" {
491491 }
492492}
493493
494test "Condition - broadcasting" {
494test "broadcasting" {
495495 // This test requires spawning threads
496496 if (builtin.single_threaded) {
497497 return error.SkipZigTest;
......@@ -557,7 +557,7 @@ test "Condition - broadcasting" {
557557 }
558558}
559559
560test "Condition - broadcasting - wake all threads" {
560test "broadcasting - wake all threads" {
561561 // Tests issue #12877
562562 // This test requires spawning threads
563563 if (builtin.single_threaded) {
lib/std/Thread/Futex.zig+4-4
......@@ -881,7 +881,7 @@ const PosixImpl = struct {
881881 }
882882};
883883
884test "Futex - smoke test" {
884test "smoke test" {
885885 var value = atomic.Value(u32).init(0);
886886
887887 // Try waits with invalid values.
......@@ -898,7 +898,7 @@ test "Futex - smoke test" {
898898 Futex.wake(&value, std.math.maxInt(u32));
899899}
900900
901test "Futex - signaling" {
901test "signaling" {
902902 // This test requires spawning threads
903903 if (builtin.single_threaded) {
904904 return error.SkipZigTest;
......@@ -952,7 +952,7 @@ test "Futex - signaling" {
952952 for (paddles) |p| try testing.expectEqual(p.current, num_iterations);
953953}
954954
955test "Futex - broadcasting" {
955test "broadcasting" {
956956 // This test requires spawning threads
957957 if (builtin.single_threaded) {
958958 return error.SkipZigTest;
......@@ -1054,7 +1054,7 @@ pub const Deadline = struct {
10541054 }
10551055};
10561056
1057test "Futex - Deadline" {
1057test "Deadline" {
10581058 var deadline = Deadline.init(100 * std.time.ns_per_ms);
10591059 var futex_word = atomic.Value(u32).init(0);
10601060
lib/std/Thread/Mutex.zig+3-3
......@@ -215,7 +215,7 @@ const FutexImpl = struct {
215215 }
216216};
217217
218test "Mutex - smoke test" {
218test "smoke test" {
219219 var mutex = Mutex{};
220220
221221 try testing.expect(mutex.tryLock());
......@@ -243,7 +243,7 @@ const NonAtomicCounter = struct {
243243 }
244244};
245245
246test "Mutex - many uncontended" {
246test "many uncontended" {
247247 // This test requires spawning threads.
248248 if (builtin.single_threaded) {
249249 return error.SkipZigTest;
......@@ -274,7 +274,7 @@ test "Mutex - many uncontended" {
274274 for (runners) |r| try testing.expectEqual(r.counter.get(), num_increments);
275275}
276276
277test "Mutex - many contended" {
277test "many contended" {
278278 // This test requires spawning threads.
279279 if (builtin.single_threaded) {
280280 return error.SkipZigTest;
lib/std/Thread/ResetEvent.zig+3-3
......@@ -157,7 +157,7 @@ const FutexImpl = struct {
157157 }
158158};
159159
160test "ResetEvent - smoke test" {
160test "smoke test" {
161161 // make sure the event is unset
162162 var event = ResetEvent{};
163163 try testing.expectEqual(false, event.isSet());
......@@ -181,7 +181,7 @@ test "ResetEvent - smoke test" {
181181 try testing.expectEqual(true, event.isSet());
182182}
183183
184test "ResetEvent - signaling" {
184test "signaling" {
185185 // This test requires spawning threads
186186 if (builtin.single_threaded) {
187187 return error.SkipZigTest;
......@@ -242,7 +242,7 @@ test "ResetEvent - signaling" {
242242 try ctx.input();
243243}
244244
245test "ResetEvent - broadcast" {
245test "broadcast" {
246246 // This test requires spawning threads
247247 if (builtin.single_threaded) {
248248 return error.SkipZigTest;
lib/std/Thread/RwLock.zig+2-2
......@@ -264,7 +264,7 @@ test "DefaultRwLock - internal state" {
264264 try testing.expectEqual(rwl, DefaultRwLock{});
265265}
266266
267test "RwLock - smoke test" {
267test "smoke test" {
268268 var rwl = RwLock{};
269269
270270 rwl.lock();
......@@ -293,7 +293,7 @@ test "RwLock - smoke test" {
293293 rwl.unlock();
294294}
295295
296test "RwLock - concurrent access" {
296test "concurrent access" {
297297 if (builtin.single_threaded)
298298 return;
299299
lib/std/Thread/Semaphore.zig+2-2
......@@ -71,7 +71,7 @@ pub fn post(sem: *Semaphore) void {
7171 sem.cond.signal();
7272}
7373
74test "Thread.Semaphore" {
74test "Semaphore" {
7575 if (builtin.single_threaded) {
7676 return error.SkipZigTest;
7777 }
......@@ -97,7 +97,7 @@ test "Thread.Semaphore" {
9797 try testing.expect(n == num_threads);
9898}
9999
100test "Thread.Semaphore - timedWait" {
100test "timedWait" {
101101 var sem = Semaphore{};
102102 try testing.expectEqual(0, sem.permits);
103103
lib/std/array_list.zig+60-51
......@@ -1231,7 +1231,7 @@ fn addOrOom(a: usize, b: usize) error{OutOfMemory}!usize {
12311231 return result;
12321232}
12331233
1234test "std.ArrayList/ArrayListUnmanaged.init" {
1234test "init" {
12351235 {
12361236 var list = ArrayList(i32).init(testing.allocator);
12371237 defer list.deinit();
......@@ -1248,7 +1248,7 @@ test "std.ArrayList/ArrayListUnmanaged.init" {
12481248 }
12491249}
12501250
1251test "std.ArrayList/ArrayListUnmanaged.initCapacity" {
1251test "initCapacity" {
12521252 const a = testing.allocator;
12531253 {
12541254 var list = try ArrayList(i8).initCapacity(a, 200);
......@@ -1264,7 +1264,7 @@ test "std.ArrayList/ArrayListUnmanaged.initCapacity" {
12641264 }
12651265}
12661266
1267test "std.ArrayList/ArrayListUnmanaged.clone" {
1267test "clone" {
12681268 const a = testing.allocator;
12691269 {
12701270 var array = ArrayList(i32).init(a);
......@@ -1305,7 +1305,7 @@ test "std.ArrayList/ArrayListUnmanaged.clone" {
13051305 }
13061306}
13071307
1308test "std.ArrayList/ArrayListUnmanaged.basic" {
1308test "basic" {
13091309 const a = testing.allocator;
13101310 {
13111311 var list = ArrayList(i32).init(a);
......@@ -1409,7 +1409,7 @@ test "std.ArrayList/ArrayListUnmanaged.basic" {
14091409 }
14101410}
14111411
1412test "std.ArrayList/ArrayListUnmanaged.appendNTimes" {
1412test "appendNTimes" {
14131413 const a = testing.allocator;
14141414 {
14151415 var list = ArrayList(i32).init(a);
......@@ -1433,7 +1433,7 @@ test "std.ArrayList/ArrayListUnmanaged.appendNTimes" {
14331433 }
14341434}
14351435
1436test "std.ArrayList/ArrayListUnmanaged.appendNTimes with failing allocator" {
1436test "appendNTimes with failing allocator" {
14371437 const a = testing.failing_allocator;
14381438 {
14391439 var list = ArrayList(i32).init(a);
......@@ -1447,7 +1447,7 @@ test "std.ArrayList/ArrayListUnmanaged.appendNTimes with failing allocator" {
14471447 }
14481448}
14491449
1450test "std.ArrayList/ArrayListUnmanaged.orderedRemove" {
1450test "orderedRemove" {
14511451 const a = testing.allocator;
14521452 {
14531453 var list = ArrayList(i32).init(a);
......@@ -1519,7 +1519,7 @@ test "std.ArrayList/ArrayListUnmanaged.orderedRemove" {
15191519 }
15201520}
15211521
1522test "std.ArrayList/ArrayListUnmanaged.swapRemove" {
1522test "swapRemove" {
15231523 const a = testing.allocator;
15241524 {
15251525 var list = ArrayList(i32).init(a);
......@@ -1575,7 +1575,7 @@ test "std.ArrayList/ArrayListUnmanaged.swapRemove" {
15751575 }
15761576}
15771577
1578test "std.ArrayList/ArrayListUnmanaged.insert" {
1578test "insert" {
15791579 const a = testing.allocator;
15801580 {
15811581 var list = ArrayList(i32).init(a);
......@@ -1605,7 +1605,7 @@ test "std.ArrayList/ArrayListUnmanaged.insert" {
16051605 }
16061606}
16071607
1608test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
1608test "insertSlice" {
16091609 const a = testing.allocator;
16101610 {
16111611 var list = ArrayList(i32).init(a);
......@@ -1651,7 +1651,7 @@ test "std.ArrayList/ArrayListUnmanaged.insertSlice" {
16511651 }
16521652}
16531653
1654test "std.ArrayList/ArrayListUnmanaged.replaceRange" {
1654test "replaceRange" {
16551655 var arena = std.heap.ArenaAllocator.init(testing.allocator);
16561656 defer arena.deinit();
16571657 const a = arena.allocator();
......@@ -1773,7 +1773,7 @@ const ItemUnmanaged = struct {
17731773 sub_items: ArrayListUnmanaged(ItemUnmanaged),
17741774};
17751775
1776test "std.ArrayList/ArrayListUnmanaged: ArrayList(T) of struct T" {
1776test "ArrayList(T) of struct T" {
17771777 const a = std.testing.allocator;
17781778 {
17791779 var root = Item{ .integer = 1, .sub_items = ArrayList(Item).init(a) };
......@@ -1789,7 +1789,7 @@ test "std.ArrayList/ArrayListUnmanaged: ArrayList(T) of struct T" {
17891789 }
17901790}
17911791
1792test "std.ArrayList(u8)/ArrayListAligned implements writer" {
1792test "ArrayList(u8) implements writer" {
17931793 const a = testing.allocator;
17941794
17951795 {
......@@ -1816,7 +1816,7 @@ test "std.ArrayList(u8)/ArrayListAligned implements writer" {
18161816 }
18171817}
18181818
1819test "std.ArrayListUnmanaged(u8) implements writer" {
1819test "ArrayListUnmanaged(u8) implements writer" {
18201820 const a = testing.allocator;
18211821
18221822 {
......@@ -1883,7 +1883,7 @@ test "shrinkAndFree with a copy" {
18831883 try testing.expect(mem.eql(i32, list.items, &.{ 3, 3, 3, 3 }));
18841884}
18851885
1886test "std.ArrayList/ArrayListUnmanaged.addManyAsArray" {
1886test "addManyAsArray" {
18871887 const a = std.testing.allocator;
18881888 {
18891889 var list = ArrayList(u8).init(a);
......@@ -1907,7 +1907,7 @@ test "std.ArrayList/ArrayListUnmanaged.addManyAsArray" {
19071907 }
19081908}
19091909
1910test "std.ArrayList/ArrayListUnmanaged growing memory preserves contents" {
1910test "growing memory preserves contents" {
19111911 // Shrink the list after every insertion to ensure that a memory growth
19121912 // will be triggered in the next operation.
19131913 const a = std.testing.allocator;
......@@ -1941,46 +1941,55 @@ test "std.ArrayList/ArrayListUnmanaged growing memory preserves contents" {
19411941 }
19421942}
19431943
1944test "std.ArrayList/ArrayList.fromOwnedSliceSentinel" {
1945 const a = testing.allocator;
1946
1947 var orig_list = ArrayList(u8).init(a);
1948 defer orig_list.deinit();
1949 try orig_list.appendSlice("foobar");
1950 const sentinel_slice = try orig_list.toOwnedSliceSentinel(0);
1951
1952 var list = ArrayList(u8).fromOwnedSliceSentinel(a, 0, sentinel_slice);
1953 defer list.deinit();
1954 try testing.expectEqualStrings(list.items, "foobar");
1955}
1956
1957test "std.ArrayList/ArrayListUnmanaged.fromOwnedSlice" {
1944test "fromOwnedSlice" {
19581945 const a = testing.allocator;
1946 {
1947 var orig_list = ArrayList(u8).init(a);
1948 defer orig_list.deinit();
1949 try orig_list.appendSlice("foobar");
19591950
1960 var list = ArrayList(u8).init(a);
1961 defer list.deinit();
1962 try list.appendSlice("foobar");
1951 const slice = try orig_list.toOwnedSlice();
1952 var list = ArrayList(u8).fromOwnedSlice(a, slice);
1953 defer list.deinit();
1954 try testing.expectEqualStrings(list.items, "foobar");
1955 }
1956 {
1957 var list = ArrayList(u8).init(a);
1958 defer list.deinit();
1959 try list.appendSlice("foobar");
19631960
1964 const slice = try list.toOwnedSlice();
1965 var unmanaged = ArrayListUnmanaged(u8).fromOwnedSlice(slice);
1966 defer unmanaged.deinit(a);
1967 try testing.expectEqualStrings(unmanaged.items, "foobar");
1961 const slice = try list.toOwnedSlice();
1962 var unmanaged = ArrayListUnmanaged(u8).fromOwnedSlice(slice);
1963 defer unmanaged.deinit(a);
1964 try testing.expectEqualStrings(unmanaged.items, "foobar");
1965 }
19681966}
19691967
1970test "std.ArrayList/ArrayListUnmanaged.fromOwnedSliceSentinel" {
1968test "fromOwnedSliceSentinel" {
19711969 const a = testing.allocator;
1970 {
1971 var orig_list = ArrayList(u8).init(a);
1972 defer orig_list.deinit();
1973 try orig_list.appendSlice("foobar");
19721974
1973 var list = ArrayList(u8).init(a);
1974 defer list.deinit();
1975 try list.appendSlice("foobar");
1975 const sentinel_slice = try orig_list.toOwnedSliceSentinel(0);
1976 var list = ArrayList(u8).fromOwnedSliceSentinel(a, 0, sentinel_slice);
1977 defer list.deinit();
1978 try testing.expectEqualStrings(list.items, "foobar");
1979 }
1980 {
1981 var list = ArrayList(u8).init(a);
1982 defer list.deinit();
1983 try list.appendSlice("foobar");
19761984
1977 const sentinel_slice = try list.toOwnedSliceSentinel(0);
1978 var unmanaged = ArrayListUnmanaged(u8).fromOwnedSliceSentinel(0, sentinel_slice);
1979 defer unmanaged.deinit(a);
1980 try testing.expectEqualStrings(unmanaged.items, "foobar");
1985 const sentinel_slice = try list.toOwnedSliceSentinel(0);
1986 var unmanaged = ArrayListUnmanaged(u8).fromOwnedSliceSentinel(0, sentinel_slice);
1987 defer unmanaged.deinit(a);
1988 try testing.expectEqualStrings(unmanaged.items, "foobar");
1989 }
19811990}
19821991
1983test "std.ArrayList/ArrayListUnmanaged.toOwnedSliceSentinel" {
1992test "toOwnedSliceSentinel" {
19841993 const a = testing.allocator;
19851994 {
19861995 var list = ArrayList(u8).init(a);
......@@ -2004,7 +2013,7 @@ test "std.ArrayList/ArrayListUnmanaged.toOwnedSliceSentinel" {
20042013 }
20052014}
20062015
2007test "ArrayListAligned/ArrayListAlignedUnmanaged accepts unaligned slices" {
2016test "accepts unaligned slices" {
20082017 const a = testing.allocator;
20092018 {
20102019 var list = std.ArrayListAligned(u8, 8).init(a);
......@@ -2028,7 +2037,7 @@ test "ArrayListAligned/ArrayListAlignedUnmanaged accepts unaligned slices" {
20282037 }
20292038}
20302039
2031test "std.ArrayList(u0)" {
2040test "ArrayList(u0)" {
20322041 // An ArrayList on zero-sized types should not need to allocate
20332042 const a = testing.failing_allocator;
20342043
......@@ -2048,7 +2057,7 @@ test "std.ArrayList(u0)" {
20482057 try testing.expectEqual(count, 3);
20492058}
20502059
2051test "std.ArrayList(?u32).popOrNull()" {
2060test "ArrayList(?u32).popOrNull()" {
20522061 const a = testing.allocator;
20532062
20542063 var list = ArrayList(?u32).init(a);
......@@ -2065,7 +2074,7 @@ test "std.ArrayList(?u32).popOrNull()" {
20652074 try testing.expect(list.popOrNull() == null);
20662075}
20672076
2068test "std.ArrayList(u32).getLast()" {
2077test "ArrayList(u32).getLast()" {
20692078 const a = testing.allocator;
20702079
20712080 var list = ArrayList(u32).init(a);
......@@ -2076,7 +2085,7 @@ test "std.ArrayList(u32).getLast()" {
20762085 try testing.expectEqual(const_list.getLast(), 2);
20772086}
20782087
2079test "std.ArrayList(u32).getLastOrNull()" {
2088test "ArrayList(u32).getLastOrNull()" {
20802089 const a = testing.allocator;
20812090
20822091 var list = ArrayList(u32).init(a);
lib/std/buf_set.zig+3-3
......@@ -101,7 +101,7 @@ pub const BufSet = struct {
101101 }
102102};
103103
104test "BufSet" {
104test BufSet {
105105 var bufset = BufSet.init(std.testing.allocator);
106106 defer bufset.deinit();
107107
......@@ -115,7 +115,7 @@ test "BufSet" {
115115 try bufset.insert("z");
116116}
117117
118test "BufSet clone" {
118test "clone" {
119119 var original = BufSet.init(testing.allocator);
120120 defer original.deinit();
121121 try original.insert("x");
......@@ -132,7 +132,7 @@ test "BufSet clone" {
132132 );
133133}
134134
135test "BufSet.clone with arena" {
135test "clone with arena" {
136136 const allocator = std.testing.allocator;
137137 var arena = std.heap.ArenaAllocator.init(allocator);
138138 defer arena.deinit();
lib/std/compress/flate.zig+5-5
......@@ -84,7 +84,7 @@ test {
8484 _ = inflate;
8585}
8686
87test "flate compress/decompress" {
87test "compress/decompress" {
8888 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
8989
9090 var cmp_buf: [64 * 1024]u8 = undefined; // compressed data buffer
......@@ -252,7 +252,7 @@ fn testDecompress(comptime container: Container, compressed: []const u8, expecte
252252 try testing.expectEqualSlices(u8, expected_plain, out.items);
253253}
254254
255test "flate don't read past deflate stream's end" {
255test "don't read past deflate stream's end" {
256256 try testDecompress(.zlib, &[_]u8{
257257 0x08, 0xd7, 0x63, 0xf8, 0xcf, 0xc0, 0xc0, 0x00, 0xc1, 0xff,
258258 0xff, 0x43, 0x30, 0x03, 0x03, 0xc3, 0xff, 0xff, 0xff, 0x01,
......@@ -264,7 +264,7 @@ test "flate don't read past deflate stream's end" {
264264 });
265265}
266266
267test "flate zlib header" {
267test "zlib header" {
268268 // Truncated header
269269 try testing.expectError(
270270 error.EndOfStream,
......@@ -292,7 +292,7 @@ test "flate zlib header" {
292292 );
293293}
294294
295test "flate gzip header" {
295test "gzip header" {
296296 // Truncated header
297297 try testing.expectError(
298298 error.EndOfStream,
......@@ -353,7 +353,7 @@ test "flate gzip header" {
353353 }, "");
354354}
355355
356test "flate public interface" {
356test "public interface" {
357357 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
358358
359359 const plain_data = [_]u8{ 'H', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd', 0x0a };
lib/std/compress/flate/CircularBuffer.zig+6-6
......@@ -130,7 +130,7 @@ pub fn full(self: *Self) bool {
130130}
131131
132132// example from: https://youtu.be/SJPvNi4HrWQ?t=3558
133test "flate.CircularBuffer writeMatch" {
133test "writeMatch" {
134134 var cb: Self = .{};
135135
136136 cb.writeAll("a salad; ");
......@@ -140,7 +140,7 @@ test "flate.CircularBuffer writeMatch" {
140140 try testing.expectEqualStrings("a salad; a salsal", cb.read());
141141}
142142
143test "flate.CircularBuffer writeMatch overlap" {
143test "writeMatch overlap" {
144144 var cb: Self = .{};
145145
146146 cb.writeAll("a b c ");
......@@ -150,7 +150,7 @@ test "flate.CircularBuffer writeMatch overlap" {
150150 try testing.expectEqualStrings("a b c b c b c d", cb.read());
151151}
152152
153test "flate.CircularBuffer readAtMost" {
153test "readAtMost" {
154154 var cb: Self = .{};
155155
156156 cb.writeAll("0123456789");
......@@ -165,7 +165,7 @@ test "flate.CircularBuffer readAtMost" {
165165 try testing.expectEqualStrings("", cb.read());
166166}
167167
168test "flate.CircularBuffer" {
168test "CircularBuffer" {
169169 var cb: Self = .{};
170170
171171 const data = "0123456789abcdef" ** (1024 / 16);
......@@ -201,7 +201,7 @@ test "flate.CircularBuffer" {
201201 try testing.expectEqual(@as(usize, 200), cb.read().len); // read the rest
202202}
203203
204test "flate.CircularBuffer write overlap" {
204test "write overlap" {
205205 var cb: Self = .{};
206206 cb.wp = cb.buffer.len - 15;
207207 cb.rp = cb.wp;
......@@ -218,7 +218,7 @@ test "flate.CircularBuffer write overlap" {
218218 try testing.expect(cb.wp == cb.rp);
219219}
220220
221test "flate.CircularBuffer writeMatch/read overlap" {
221test "writeMatch/read overlap" {
222222 var cb: Self = .{};
223223 cb.wp = cb.buffer.len - 15;
224224 cb.rp = cb.wp;
lib/std/compress/flate/Lookup.zig+2-2
......@@ -83,7 +83,7 @@ fn hashu(v: u32) u32 {
8383 return @intCast((v *% prime4) >> consts.lookup.shift);
8484}
8585
86test "flate.Lookup add/prev" {
86test "add/prev" {
8787 const data = [_]u8{
8888 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
8989 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
......@@ -107,7 +107,7 @@ test "flate.Lookup add/prev" {
107107 try expect(h.chain[2 + 8] == 2);
108108}
109109
110test "flate.Lookup bulkAdd" {
110test "bulkAdd" {
111111 const data = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
112112
113113 // one by one
lib/std/compress/flate/SlidingWindow.zig+2-2
......@@ -122,7 +122,7 @@ pub fn tokensBuffer(self: *Self) ?[]const u8 {
122122 return self.buffer[@intCast(self.fp)..self.rp];
123123}
124124
125test "flate.SlidingWindow match" {
125test "match" {
126126 const data = "Blah blah blah blah blah!";
127127 var win: Self = .{};
128128 try expect(win.write(data) == data.len);
......@@ -142,7 +142,7 @@ test "flate.SlidingWindow match" {
142142 try expect(win.match(15, 20, 4) == 0);
143143}
144144
145test "flate.SlidingWindow slide" {
145test "slide" {
146146 var win: Self = .{};
147147 win.wp = Self.buffer_len - 11;
148148 win.rp = Self.buffer_len - 111;
lib/std/compress/flate/Token.zig+4-4
......@@ -275,12 +275,12 @@ const match_distances = [_]MatchDistance{
275275 .{ .extra_bits = 13, .base_scaled = 0x6000, .code = 29, .base = 24577 },
276276};
277277
278test "flate.Token size" {
278test "size" {
279279 try expect(@sizeOf(Token) == 4);
280280}
281281
282282// testing table https://datatracker.ietf.org/doc/html/rfc1951#page-12
283test "flate.Token MatchLength" {
283test "MatchLength" {
284284 var c = Token.initMatch(1, 4).lengthEncoding();
285285 try expect(c.code == 258);
286286 try expect(c.extra_bits == 0);
......@@ -302,7 +302,7 @@ test "flate.Token MatchLength" {
302302 try expect(c.extra_length == 130 - 115);
303303}
304304
305test "flate.Token MatchDistance" {
305test "MatchDistance" {
306306 var c = Token.initMatch(1, 4).distanceEncoding();
307307 try expect(c.code == 0);
308308 try expect(c.extra_bits == 0);
......@@ -314,7 +314,7 @@ test "flate.Token MatchDistance" {
314314 try expect(c.extra_distance == 192 - 129);
315315}
316316
317test "flate.Token match_lengths" {
317test "match_lengths" {
318318 for (match_lengths, 0..) |ml, i| {
319319 try expect(@as(u16, ml.base_scaled) + 3 == ml.base);
320320 try expect(i + 257 == ml.code);
lib/std/compress/flate/bit_reader.zig+5-5
......@@ -218,7 +218,7 @@ pub fn BitReader(comptime ReaderType: type) type {
218218 };
219219}
220220
221test "flate.BitReader" {
221test "BitReader" {
222222 var fbs = std.io.fixedBufferStream(&[_]u8{ 0xf3, 0x48, 0xcd, 0xc9, 0x00, 0x00 });
223223 var br = bitReader(fbs.reader());
224224 const F = BitReader(@TypeOf(fbs.reader())).flag;
......@@ -253,7 +253,7 @@ test "flate.BitReader" {
253253 try testing.expectEqual(@as(u16, 0xc), try br.readN(4, 0));
254254}
255255
256test "flate.BitReader read block type 1 data" {
256test "read block type 1 data" {
257257 const data = [_]u8{
258258 0xf3, 0x48, 0xcd, 0xc9, 0xc9, 0x57, 0x28, 0xcf, // deflate data block type 1
259259 0x2f, 0xca, 0x49, 0xe1, 0x02, 0x00,
......@@ -277,7 +277,7 @@ test "flate.BitReader read block type 1 data" {
277277 try testing.expectEqual(@as(u16, 0xddcc), try br.readF(u16, 0));
278278}
279279
280test "flate.BitReader init" {
280test "init" {
281281 const data = [_]u8{
282282 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
283283 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
......@@ -302,7 +302,7 @@ test "flate.BitReader init" {
302302 try testing.expectEqual(@as(u64, 0x00_00_00_00_00_08_07_06), br.bits);
303303}
304304
305test "flate.BitReader readAll" {
305test "readAll" {
306306 const data = [_]u8{
307307 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
308308 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
......@@ -320,7 +320,7 @@ test "flate.BitReader readAll" {
320320 try testing.expectEqualSlices(u8, data[0..16], &out);
321321}
322322
323test "flate.BitReader readFixedCode" {
323test "readFixedCode" {
324324 const fixed_codes = @import("huffman_encoder.zig").fixed_codes;
325325
326326 var fbs = std.io.fixedBufferStream(&fixed_codes);
lib/std/compress/flate/block_writer.zig+3-3
......@@ -596,20 +596,20 @@ const TestCase = @import("testdata/block_writer.zig").TestCase;
596596const testCases = @import("testdata/block_writer.zig").testCases;
597597
598598// tests if the writeBlock encoding has changed.
599test "flate.BlockWriter write" {
599test "write" {
600600 inline for (0..testCases.len) |i| {
601601 try testBlock(testCases[i], .write_block);
602602 }
603603}
604604
605605// tests if the writeBlockDynamic encoding has changed.
606test "flate.BlockWriter dynamicBlock" {
606test "dynamicBlock" {
607607 inline for (0..testCases.len) |i| {
608608 try testBlock(testCases[i], .write_dyn_block);
609609 }
610610}
611611
612test "flate.BlockWriter huffmanBlock" {
612test "huffmanBlock" {
613613 inline for (0..testCases.len) |i| {
614614 try testBlock(testCases[i], .write_huffman_block);
615615 }
lib/std/compress/flate/huffman_decoder.zig+5-11
......@@ -93,7 +93,6 @@ fn HuffmanDecoder(
9393 var code: u16 = 0;
9494 var idx: u16 = 0;
9595 for (&self.symbols, 0..) |*sym, pos| {
96 //print("sym: {}\n", .{sym});
9796 if (sym.code_bits == 0) continue; // skip unused
9897 sym.code = code;
9998
......@@ -116,7 +115,6 @@ fn HuffmanDecoder(
116115 idx = next_idx;
117116 code = next_code;
118117 }
119 //print("decoder generate, code: {d}, idx: {d}\n", .{ code, idx });
120118 }
121119
122120 /// Given the list of code lengths check that it represents a canonical
......@@ -176,7 +174,7 @@ fn HuffmanDecoder(
176174 };
177175}
178176
179test "flate.HuffmanDecoder init/find" {
177test "init/find" {
180178 // example data from: https://youtu.be/SJPvNi4HrWQ?t=8423
181179 const code_lens = [_]u4{ 4, 3, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 2 };
182180 var h: CodegenDecoder = .{};
......@@ -252,11 +250,7 @@ test "flate.HuffmanDecoder init/find" {
252250 try testing.expectEqual(16, (try h.find(@intCast(c))).symbol);
253251}
254252
255const print = std.debug.print;
256const assert = std.debug.assert;
257const expect = std.testing.expect;
258
259test "flate.HuffmanDecoder encode/decode literals" {
253test "encode/decode literals" {
260254 const LiteralEncoder = @import("huffman_encoder.zig").LiteralEncoder;
261255
262256 for (1..286) |j| { // for all different number of codes
......@@ -292,7 +286,7 @@ test "flate.HuffmanDecoder encode/decode literals" {
292286 };
293287
294288 const c = enc.codes[symbol];
295 try expect(c.code == c_code);
289 try testing.expect(c.code == c_code);
296290 }
297291
298292 // find each symbol by code
......@@ -301,8 +295,8 @@ test "flate.HuffmanDecoder encode/decode literals" {
301295
302296 const s_code: u15 = @bitReverse(@as(u15, @intCast(c.code)));
303297 const s = try dec.find(s_code);
304 try expect(s.code == s_code);
305 try expect(s.code_bits == c.len);
298 try testing.expect(s.code == s_code);
299 try testing.expect(s.code_bits == c.len);
306300 }
307301 }
308302}
lib/std/compress/flate/huffman_encoder.zig+5-5
......@@ -360,7 +360,7 @@ fn byFreq(context: void, a: LiteralNode, b: LiteralNode) bool {
360360 return a.freq < b.freq;
361361}
362362
363test "flate.HuffmanEncoder generate a Huffman code from an array of frequencies" {
363test "generate a Huffman code from an array of frequencies" {
364364 var freqs: [19]u16 = [_]u16{
365365 8, // 0
366366 1, // 1
......@@ -421,7 +421,7 @@ test "flate.HuffmanEncoder generate a Huffman code from an array of frequencies"
421421 try testing.expectEqual(@as(u16, 0x3f), enc.codes[16].code);
422422}
423423
424test "flate.HuffmanEncoder generate a Huffman code for the fixed literal table specific to Deflate" {
424test "generate a Huffman code for the fixed literal table specific to Deflate" {
425425 const enc = fixedLiteralEncoder();
426426 for (enc.codes) |c| {
427427 switch (c.len) {
......@@ -443,7 +443,7 @@ test "flate.HuffmanEncoder generate a Huffman code for the fixed literal table s
443443 }
444444}
445445
446test "flate.HuffmanEncoder generate a Huffman code for the 30 possible relative distances (LZ77 distances) of Deflate" {
446test "generate a Huffman code for the 30 possible relative distances (LZ77 distances) of Deflate" {
447447 const enc = fixedDistanceEncoder();
448448 for (enc.codes) |c| {
449449 const v = @bitReverse(@as(u5, @intCast(c.code)));
......@@ -458,7 +458,7 @@ fn bitReverse(comptime T: type, value: T, n: usize) T {
458458 return r >> @as(math.Log2Int(T), @intCast(@typeInfo(T).Int.bits - n));
459459}
460460
461test "flate bitReverse" {
461test "bitReverse" {
462462 const ReverseBitsTest = struct {
463463 in: u16,
464464 bit_count: u5,
......@@ -482,7 +482,7 @@ test "flate bitReverse" {
482482 }
483483}
484484
485test "flate.HuffmanEncoder fixedLiteralEncoder codes" {
485test "fixedLiteralEncoder codes" {
486486 var al = std.ArrayList(u8).init(testing.allocator);
487487 defer al.deinit();
488488 var bw = std.io.bitWriter(.little, al.writer());
lib/std/compress/flate/inflate.zig+5-5
......@@ -342,7 +342,7 @@ pub fn Inflate(comptime container: Container, comptime ReaderType: type) type {
342342 };
343343}
344344
345test "flate.Inflate decompress" {
345test "decompress" {
346346 const cases = [_]struct {
347347 in: []const u8,
348348 out: []const u8,
......@@ -383,7 +383,7 @@ test "flate.Inflate decompress" {
383383 }
384384}
385385
386test "flate.Inflate gzip decompress" {
386test "gzip decompress" {
387387 const cases = [_]struct {
388388 in: []const u8,
389389 out: []const u8,
......@@ -440,7 +440,7 @@ test "flate.Inflate gzip decompress" {
440440 }
441441}
442442
443test "flate.Inflate zlib decompress" {
443test "zlib decompress" {
444444 const cases = [_]struct {
445445 in: []const u8,
446446 out: []const u8,
......@@ -466,7 +466,7 @@ test "flate.Inflate zlib decompress" {
466466 }
467467}
468468
469test "flate.Inflate fuzzing tests" {
469test "fuzzing tests" {
470470 const cases = [_]struct {
471471 input: []const u8,
472472 out: []const u8 = "",
......@@ -529,7 +529,7 @@ test "flate.Inflate fuzzing tests" {
529529 }
530530}
531531
532test "flate bug 18966" {
532test "bug 18966" {
533533 const input = @embedFile("testdata/fuzz/bug_18966.input");
534534 const expect = @embedFile("testdata/fuzz/bug_18966.expect");
535535
lib/std/compress/lzma/test.zig+8-8
......@@ -21,7 +21,7 @@ fn testDecompressError(expected: anyerror, compressed: []const u8) !void {
2121 return std.testing.expectError(expected, testDecompress(compressed));
2222}
2323
24test "LZMA: decompress empty world" {
24test "decompress empty world" {
2525 try testDecompressEqual(
2626 "",
2727 &[_]u8{
......@@ -31,7 +31,7 @@ test "LZMA: decompress empty world" {
3131 );
3232}
3333
34test "LZMA: decompress hello world" {
34test "decompress hello world" {
3535 try testDecompressEqual(
3636 "Hello world\n",
3737 &[_]u8{
......@@ -42,7 +42,7 @@ test "LZMA: decompress hello world" {
4242 );
4343}
4444
45test "LZMA: decompress huge dict" {
45test "decompress huge dict" {
4646 try testDecompressEqual(
4747 "Hello world\n",
4848 &[_]u8{
......@@ -53,35 +53,35 @@ test "LZMA: decompress huge dict" {
5353 );
5454}
5555
56test "LZMA: unknown size with end of payload marker" {
56test "unknown size with end of payload marker" {
5757 try testDecompressEqual(
5858 "Hello\nWorld!\n",
5959 @embedFile("testdata/good-unknown_size-with_eopm.lzma"),
6060 );
6161}
6262
63test "LZMA: known size without end of payload marker" {
63test "known size without end of payload marker" {
6464 try testDecompressEqual(
6565 "Hello\nWorld!\n",
6666 @embedFile("testdata/good-known_size-without_eopm.lzma"),
6767 );
6868}
6969
70test "LZMA: known size with end of payload marker" {
70test "known size with end of payload marker" {
7171 try testDecompressEqual(
7272 "Hello\nWorld!\n",
7373 @embedFile("testdata/good-known_size-with_eopm.lzma"),
7474 );
7575}
7676
77test "LZMA: too big uncompressed size in header" {
77test "too big uncompressed size in header" {
7878 try testDecompressError(
7979 error.CorruptInput,
8080 @embedFile("testdata/bad-too_big_size-with_eopm.lzma"),
8181 );
8282}
8383
84test "LZMA: too small uncompressed size in header" {
84test "too small uncompressed size in header" {
8585 try testDecompressError(
8686 error.CorruptInput,
8787 @embedFile("testdata/bad-too_small_size-without_eopm-3.lzma"),
lib/std/compress/lzma/vec2d.zig+7-7
......@@ -49,7 +49,7 @@ const testing = std.testing;
4949const expectEqualSlices = std.testing.expectEqualSlices;
5050const expectError = std.testing.expectError;
5151
52test "Vec2D.init" {
52test "init" {
5353 const allocator = testing.allocator;
5454 var vec2d = try Vec2D(i32).init(allocator, 1, .{ 2, 3 });
5555 defer vec2d.deinit(allocator);
......@@ -58,7 +58,7 @@ test "Vec2D.init" {
5858 try expectEqualSlices(i32, &.{ 1, 1, 1 }, try vec2d.get(1));
5959}
6060
61test "Vec2D.init overflow" {
61test "init overflow" {
6262 const allocator = testing.allocator;
6363 try expectError(
6464 error.Overflow,
......@@ -66,7 +66,7 @@ test "Vec2D.init overflow" {
6666 );
6767}
6868
69test "Vec2D.fill" {
69test "fill" {
7070 const allocator = testing.allocator;
7171 var vec2d = try Vec2D(i32).init(allocator, 0, .{ 2, 3 });
7272 defer vec2d.deinit(allocator);
......@@ -77,7 +77,7 @@ test "Vec2D.fill" {
7777 try expectEqualSlices(i32, &.{ 7, 7, 7 }, try vec2d.get(1));
7878}
7979
80test "Vec2D.get" {
80test "get" {
8181 var data = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7 };
8282 const vec2d = Vec2D(i32){
8383 .data = &data,
......@@ -90,7 +90,7 @@ test "Vec2D.get" {
9090 try expectEqualSlices(i32, &.{ 6, 7 }, try vec2d.get(3));
9191}
9292
93test "Vec2D.getMut" {
93test "getMut" {
9494 var data = [_]i32{ 0, 1, 2, 3, 4, 5, 6, 7 };
9595 var vec2d = Vec2D(i32){
9696 .data = &data,
......@@ -107,7 +107,7 @@ test "Vec2D.getMut" {
107107 try expectEqualSlices(i32, &.{ 6, 7 }, try vec2d.get(3));
108108}
109109
110test "Vec2D.get multiplication overflow" {
110test "get multiplication overflow" {
111111 const allocator = testing.allocator;
112112 var matrix = try Vec2D(i32).init(allocator, 0, .{ 3, 4 });
113113 defer matrix.deinit(allocator);
......@@ -117,7 +117,7 @@ test "Vec2D.get multiplication overflow" {
117117 try expectError(error.Overflow, matrix.getMut(row));
118118}
119119
120test "Vec2D.get addition overflow" {
120test "get addition overflow" {
121121 const allocator = testing.allocator;
122122 var matrix = try Vec2D(i32).init(allocator, 0, .{ 3, 5 });
123123 defer matrix.deinit(allocator);
lib/std/compress/zstandard.zig+2-2
......@@ -222,7 +222,7 @@ fn testReader(data: []const u8, comptime expected: []const u8) !void {
222222 try std.testing.expectEqualSlices(u8, expected, buf);
223223}
224224
225test "zstandard decompression" {
225test "decompression" {
226226 const uncompressed = @embedFile("testdata/rfc8478.txt");
227227 const compressed3 = @embedFile("testdata/rfc8478.txt.zst.3");
228228 const compressed19 = @embedFile("testdata/rfc8478.txt.zst.19");
......@@ -239,7 +239,7 @@ test "zstandard decompression" {
239239 try std.testing.expectEqualSlices(u8, uncompressed, buffer);
240240}
241241
242test "zstandard streaming decompression" {
242test "streaming decompression" {
243243 // default stack size for wasm32 is too low for Decompressor - slightly
244244 // over 1MiB stack space is needed via the --stack CLI flag
245245 if (@import("builtin").target.cpu.arch == .wasm32) return error.SkipZigTest;
lib/std/comptime_string_map.zig+9-9
......@@ -142,7 +142,7 @@ const TestEnum = enum {
142142 E,
143143};
144144
145test "ComptimeStringMap list literal of list literals" {
145test "list literal of list literals" {
146146 const map = ComptimeStringMap(TestEnum, .{
147147 .{ "these", .D },
148148 .{ "have", .A },
......@@ -157,7 +157,7 @@ test "ComptimeStringMap list literal of list literals" {
157157 try std.testing.expect(null == map.get("NOTHING"));
158158}
159159
160test "ComptimeStringMap array of structs" {
160test "array of structs" {
161161 const KV = struct { []const u8, TestEnum };
162162 const map = ComptimeStringMap(TestEnum, [_]KV{
163163 .{ "these", .D },
......@@ -170,7 +170,7 @@ test "ComptimeStringMap array of structs" {
170170 try testMap(map);
171171}
172172
173test "ComptimeStringMap slice of structs" {
173test "slice of structs" {
174174 const KV = struct { []const u8, TestEnum };
175175 const slice: []const KV = &[_]KV{
176176 .{ "these", .D },
......@@ -198,7 +198,7 @@ fn testMap(comptime map: anytype) !void {
198198 try std.testing.expect(null == map.get("averylongstringthathasnomatches"));
199199}
200200
201test "ComptimeStringMap void value type, slice of structs" {
201test "void value type, slice of structs" {
202202 const KV = struct { []const u8 };
203203 const slice: []const KV = &[_]KV{
204204 .{"these"},
......@@ -215,7 +215,7 @@ test "ComptimeStringMap void value type, slice of structs" {
215215 try std.testing.expect(null == map.get("NOTHING"));
216216}
217217
218test "ComptimeStringMap void value type, list literal of list literals" {
218test "void value type, list literal of list literals" {
219219 const map = ComptimeStringMap(void, .{
220220 .{"these"},
221221 .{"have"},
......@@ -258,7 +258,7 @@ test "ComptimeStringMapWithEql" {
258258 try std.testing.expect(map.has("ThESe"));
259259}
260260
261test "ComptimeStringMap empty" {
261test "empty" {
262262 const m1 = ComptimeStringMap(usize, .{});
263263 try std.testing.expect(null == m1.get("anything"));
264264
......@@ -266,7 +266,7 @@ test "ComptimeStringMap empty" {
266266 try std.testing.expect(null == m2.get("anything"));
267267}
268268
269test "ComptimeStringMap redundant entries" {
269test "redundant entries" {
270270 const map = ComptimeStringMap(TestEnum, .{
271271 .{ "redundant", .D },
272272 .{ "theNeedle", .A },
......@@ -284,7 +284,7 @@ test "ComptimeStringMap redundant entries" {
284284 try std.testing.expectEqual(TestEnum.A, map.get("theNeedle").?);
285285}
286286
287test "ComptimeStringMap redundant insensitive" {
287test "redundant insensitive" {
288288 const map = ComptimeStringMapWithEql(TestEnum, .{
289289 .{ "redundant", .D },
290290 .{ "theNeedle", .A },
......@@ -300,7 +300,7 @@ test "ComptimeStringMap redundant insensitive" {
300300 try std.testing.expectEqual(TestEnum.A, map.get("theNeedle").?);
301301}
302302
303test "ComptimeStringMap comptime-only value" {
303test "comptime-only value" {
304304 const map = std.ComptimeStringMap(type, .{
305305 .{ "a", struct {
306306 pub const foo = 1;
lib/std/crypto/25519/curve25519.zig+1-1
......@@ -137,7 +137,7 @@ test "non-affine edwards25519 to curve25519 projection" {
137137 try std.testing.expectEqualSlices(u8, &xp.toBytes(), &expected);
138138}
139139
140test "curve25519 small order check" {
140test "small order check" {
141141 var s: [32]u8 = [_]u8{1} ++ [_]u8{0} ** 31;
142142 const small_order_ss: [7][32]u8 = .{
143143 .{
lib/std/crypto/25519/ed25519.zig+7-7
......@@ -482,7 +482,7 @@ pub const Ed25519 = struct {
482482 };
483483};
484484
485test "ed25519 key pair creation" {
485test "key pair creation" {
486486 var seed: [32]u8 = undefined;
487487 _ = try fmt.hexToBytes(seed[0..], "8052030376d47112be7f73ed7a019293dd12ad910b654455798b4667d73de166");
488488 const key_pair = try Ed25519.KeyPair.create(seed);
......@@ -491,7 +491,7 @@ test "ed25519 key pair creation" {
491491 try std.testing.expectEqualStrings(try std.fmt.bufPrint(&buf, "{s}", .{std.fmt.fmtSliceHexUpper(&key_pair.public_key.toBytes())}), "2D6F7455D97B4A3A10D7293909D1A4F2058CB9A370E43FA8154BB280DB839083");
492492}
493493
494test "ed25519 signature" {
494test "signature" {
495495 var seed: [32]u8 = undefined;
496496 _ = try fmt.hexToBytes(seed[0..], "8052030376d47112be7f73ed7a019293dd12ad910b654455798b4667d73de166");
497497 const key_pair = try Ed25519.KeyPair.create(seed);
......@@ -503,7 +503,7 @@ test "ed25519 signature" {
503503 try std.testing.expectError(error.SignatureVerificationFailed, sig.verify("TEST", key_pair.public_key));
504504}
505505
506test "ed25519 batch verification" {
506test "batch verification" {
507507 var i: usize = 0;
508508 while (i < 100) : (i += 1) {
509509 const key_pair = try Ed25519.KeyPair.create(null);
......@@ -532,7 +532,7 @@ test "ed25519 batch verification" {
532532 }
533533}
534534
535test "ed25519 test vectors" {
535test "test vectors" {
536536 const Vec = struct {
537537 msg_hex: *const [64:0]u8,
538538 public_key_hex: *const [64:0]u8,
......@@ -634,7 +634,7 @@ test "ed25519 test vectors" {
634634 }
635635}
636636
637test "ed25519 with blind keys" {
637test "with blind keys" {
638638 const BlindKeyPair = Ed25519.key_blinding.BlindKeyPair;
639639
640640 // Create a standard Ed25519 key pair
......@@ -657,7 +657,7 @@ test "ed25519 with blind keys" {
657657 try std.testing.expectEqualSlices(u8, &pk.toBytes(), &kp.public_key.toBytes());
658658}
659659
660test "ed25519 signatures with streaming" {
660test "signatures with streaming" {
661661 const kp = try Ed25519.KeyPair.create(null);
662662
663663 var signer = try kp.signer(null);
......@@ -673,7 +673,7 @@ test "ed25519 signatures with streaming" {
673673 try verifier.verify();
674674}
675675
676test "ed25519 key pair from secret key" {
676test "key pair from secret key" {
677677 const kp = try Ed25519.KeyPair.create(null);
678678 const kp2 = try Ed25519.KeyPair.fromSecretKey(kp.secret_key);
679679 try std.testing.expectEqualSlices(u8, &kp.secret_key.toBytes(), &kp2.secret_key.toBytes());
lib/std/crypto/25519/edwards25519.zig+5-5
......@@ -493,7 +493,7 @@ pub const Edwards25519 = struct {
493493
494494const htest = @import("../test.zig");
495495
496test "edwards25519 packing/unpacking" {
496test "packing/unpacking" {
497497 const s = [_]u8{170} ++ [_]u8{0} ** 31;
498498 var b = Edwards25519.basePoint;
499499 const pk = try b.mul(s);
......@@ -529,7 +529,7 @@ test "edwards25519 packing/unpacking" {
529529 }
530530}
531531
532test "edwards25519 point addition/subtraction" {
532test "point addition/subtraction" {
533533 var s1: [32]u8 = undefined;
534534 var s2: [32]u8 = undefined;
535535 crypto.random.bytes(&s1);
......@@ -543,7 +543,7 @@ test "edwards25519 point addition/subtraction" {
543543 try std.testing.expectError(error.IdentityElement, p.sub(q).add(q).sub(p).rejectIdentity());
544544}
545545
546test "edwards25519 uniform-to-point" {
546test "uniform-to-point" {
547547 var r = [32]u8{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 };
548548 var p = Edwards25519.fromUniform(r);
549549 try htest.assertEqual("0691eee3cf70a0056df6bfa03120635636581b5c4ea571dfc680f78c7e0b4137", p.toBytes()[0..]);
......@@ -554,7 +554,7 @@ test "edwards25519 uniform-to-point" {
554554}
555555
556556// Test vectors from draft-irtf-cfrg-hash-to-curve-12
557test "edwards25519 hash-to-curve operation" {
557test "hash-to-curve operation" {
558558 var p = Edwards25519.fromString(true, "QUUX-V01-CS02-with-edwards25519_XMD:SHA-512_ELL2_RO_", "abc");
559559 try htest.assertEqual("31558a26887f23fb8218f143e69d5f0af2e7831130bd5b432ef23883b895839a", p.toBytes()[0..]);
560560
......@@ -562,7 +562,7 @@ test "edwards25519 hash-to-curve operation" {
562562 try htest.assertEqual("42fa27c8f5a1ae0aa38bb59d5938e5145622ba5dedd11d11736fa2f9502d7367", p.toBytes()[0..]);
563563}
564564
565test "edwards25519 implicit reduction of invalid scalars" {
565test "implicit reduction of invalid scalars" {
566566 const s = [_]u8{0} ** 31 ++ [_]u8{255};
567567 const p1 = try Edwards25519.basePoint.mulPublic(s);
568568 const p2 = try Edwards25519.basePoint.mul(s);
lib/std/crypto/25519/x25519.zig+6-6
......@@ -81,7 +81,7 @@ pub const X25519 = struct {
8181
8282const htest = @import("../test.zig");
8383
84test "x25519 public key calculation from secret key" {
84test "public key calculation from secret key" {
8585 var sk: [32]u8 = undefined;
8686 var pk_expected: [32]u8 = undefined;
8787 _ = try fmt.hexToBytes(sk[0..], "8052030376d47112be7f73ed7a019293dd12ad910b654455798b4667d73de166");
......@@ -90,7 +90,7 @@ test "x25519 public key calculation from secret key" {
9090 try std.testing.expectEqual(pk_calculated, pk_expected);
9191}
9292
93test "x25519 rfc7748 vector1" {
93test "rfc7748 vector1" {
9494 const secret_key = [32]u8{ 0xa5, 0x46, 0xe3, 0x6b, 0xf0, 0x52, 0x7c, 0x9d, 0x3b, 0x16, 0x15, 0x4b, 0x82, 0x46, 0x5e, 0xdd, 0x62, 0x14, 0x4c, 0x0a, 0xc1, 0xfc, 0x5a, 0x18, 0x50, 0x6a, 0x22, 0x44, 0xba, 0x44, 0x9a, 0xc4 };
9595 const public_key = [32]u8{ 0xe6, 0xdb, 0x68, 0x67, 0x58, 0x30, 0x30, 0xdb, 0x35, 0x94, 0xc1, 0xa4, 0x24, 0xb1, 0x5f, 0x7c, 0x72, 0x66, 0x24, 0xec, 0x26, 0xb3, 0x35, 0x3b, 0x10, 0xa9, 0x03, 0xa6, 0xd0, 0xab, 0x1c, 0x4c };
9696
......@@ -100,7 +100,7 @@ test "x25519 rfc7748 vector1" {
100100 try std.testing.expectEqual(output, expected_output);
101101}
102102
103test "x25519 rfc7748 vector2" {
103test "rfc7748 vector2" {
104104 const secret_key = [32]u8{ 0x4b, 0x66, 0xe9, 0xd4, 0xd1, 0xb4, 0x67, 0x3c, 0x5a, 0xd2, 0x26, 0x91, 0x95, 0x7d, 0x6a, 0xf5, 0xc1, 0x1b, 0x64, 0x21, 0xe0, 0xea, 0x01, 0xd4, 0x2c, 0xa4, 0x16, 0x9e, 0x79, 0x18, 0xba, 0x0d };
105105 const public_key = [32]u8{ 0xe5, 0x21, 0x0f, 0x12, 0x78, 0x68, 0x11, 0xd3, 0xf4, 0xb7, 0x95, 0x9d, 0x05, 0x38, 0xae, 0x2c, 0x31, 0xdb, 0xe7, 0x10, 0x6f, 0xc0, 0x3c, 0x3e, 0xfc, 0x4c, 0xd5, 0x49, 0xc7, 0x15, 0xa4, 0x93 };
106106
......@@ -110,7 +110,7 @@ test "x25519 rfc7748 vector2" {
110110 try std.testing.expectEqual(output, expected_output);
111111}
112112
113test "x25519 rfc7748 one iteration" {
113test "rfc7748 one iteration" {
114114 const initial_value = [32]u8{ 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
115115 const expected_output = [32]u8{ 0x42, 0x2c, 0x8e, 0x7a, 0x62, 0x27, 0xd7, 0xbc, 0xa1, 0x35, 0x0b, 0x3e, 0x2b, 0xb7, 0x27, 0x9f, 0x78, 0x97, 0xb8, 0x7b, 0xb6, 0x85, 0x4b, 0x78, 0x3c, 0x60, 0xe8, 0x03, 0x11, 0xae, 0x30, 0x79 };
116116
......@@ -127,7 +127,7 @@ test "x25519 rfc7748 one iteration" {
127127 try std.testing.expectEqual(k, expected_output);
128128}
129129
130test "x25519 rfc7748 1,000 iterations" {
130test "rfc7748 1,000 iterations" {
131131 // These iteration tests are slow so we always skip them. Results have been verified.
132132 if (true) {
133133 return error.SkipZigTest;
......@@ -149,7 +149,7 @@ test "x25519 rfc7748 1,000 iterations" {
149149 try std.testing.expectEqual(k, expected_output);
150150}
151151
152test "x25519 rfc7748 1,000,000 iterations" {
152test "rfc7748 1,000,000 iterations" {
153153 if (true) {
154154 return error.SkipZigTest;
155155 }
lib/std/crypto/chacha20.zig+8-8
......@@ -758,7 +758,7 @@ fn XChaChaPoly1305(comptime rounds_nb: usize) type {
758758 };
759759}
760760
761test "chacha20 AEAD API" {
761test "AEAD API" {
762762 const aeads = [_]type{ ChaCha20Poly1305, XChaCha20Poly1305 };
763763 const m = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.";
764764 const ad = "Additional data";
......@@ -779,7 +779,7 @@ test "chacha20 AEAD API" {
779779}
780780
781781// https://tools.ietf.org/html/rfc7539#section-2.4.2
782test "crypto.chacha20 test vector sunscreen" {
782test "test vector sunscreen" {
783783 const expected_result = [_]u8{
784784 0x6e, 0x2e, 0x35, 0x9a, 0x25, 0x68, 0xf9, 0x80,
785785 0x41, 0xba, 0x07, 0x28, 0xdd, 0x0d, 0x69, 0x81,
......@@ -820,7 +820,7 @@ test "crypto.chacha20 test vector sunscreen" {
820820}
821821
822822// https://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-04#section-7
823test "crypto.chacha20 test vector 1" {
823test "test vector 1" {
824824 const expected_result = [_]u8{
825825 0x76, 0xb8, 0xe0, 0xad, 0xa0, 0xf1, 0x3d, 0x90,
826826 0x40, 0x5d, 0x6a, 0xe5, 0x53, 0x86, 0xbd, 0x28,
......@@ -854,7 +854,7 @@ test "crypto.chacha20 test vector 1" {
854854 try testing.expectEqualSlices(u8, &expected_result, &result);
855855}
856856
857test "crypto.chacha20 test vector 2" {
857test "test vector 2" {
858858 const expected_result = [_]u8{
859859 0x45, 0x40, 0xf0, 0x5a, 0x9f, 0x1f, 0xb2, 0x96,
860860 0xd7, 0x73, 0x6e, 0x7b, 0x20, 0x8e, 0x3c, 0x96,
......@@ -888,7 +888,7 @@ test "crypto.chacha20 test vector 2" {
888888 try testing.expectEqualSlices(u8, &expected_result, &result);
889889}
890890
891test "crypto.chacha20 test vector 3" {
891test "test vector 3" {
892892 const expected_result = [_]u8{
893893 0xde, 0x9c, 0xba, 0x7b, 0xf3, 0xd6, 0x9e, 0xf5,
894894 0xe7, 0x86, 0xdc, 0x63, 0x97, 0x3f, 0x65, 0x3a,
......@@ -922,7 +922,7 @@ test "crypto.chacha20 test vector 3" {
922922 try testing.expectEqualSlices(u8, &expected_result, &result);
923923}
924924
925test "crypto.chacha20 test vector 4" {
925test "test vector 4" {
926926 const expected_result = [_]u8{
927927 0xef, 0x3f, 0xdf, 0xd6, 0xc6, 0x15, 0x78, 0xfb,
928928 0xf5, 0xcf, 0x35, 0xbd, 0x3d, 0xd3, 0x3b, 0x80,
......@@ -956,7 +956,7 @@ test "crypto.chacha20 test vector 4" {
956956 try testing.expectEqualSlices(u8, &expected_result, &result);
957957}
958958
959test "crypto.chacha20 test vector 5" {
959test "test vector 5" {
960960 const expected_result = [_]u8{
961961 0xf7, 0x98, 0xa1, 0x89, 0xf1, 0x95, 0xe6, 0x69,
962962 0x82, 0x10, 0x5f, 0xfb, 0x64, 0x0b, 0xb7, 0x75,
......@@ -1142,7 +1142,7 @@ test "open" {
11421142 }
11431143}
11441144
1145test "crypto.xchacha20" {
1145test "xchacha20" {
11461146 const key = [_]u8{69} ** 32;
11471147 const nonce = [_]u8{42} ** 24;
11481148 const m = "Ladies and Gentlemen of the class of '99: If I could offer you only one tip for the future, sunscreen would be it.";
lib/std/crypto/ecdsa.zig+6-6
......@@ -371,7 +371,7 @@ pub fn Ecdsa(comptime Curve: type, comptime Hash: type) type {
371371 };
372372}
373373
374test "ECDSA - Basic operations over EcdsaP384Sha384" {
374test "Basic operations over EcdsaP384Sha384" {
375375 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
376376
377377 const Scheme = EcdsaP384Sha384;
......@@ -387,7 +387,7 @@ test "ECDSA - Basic operations over EcdsaP384Sha384" {
387387 try sig2.verify(msg, kp.public_key);
388388}
389389
390test "ECDSA - Basic operations over Secp256k1" {
390test "Basic operations over Secp256k1" {
391391 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
392392
393393 const Scheme = EcdsaSecp256k1Sha256oSha256;
......@@ -403,7 +403,7 @@ test "ECDSA - Basic operations over Secp256k1" {
403403 try sig2.verify(msg, kp.public_key);
404404}
405405
406test "ECDSA - Basic operations over EcdsaP384Sha256" {
406test "Basic operations over EcdsaP384Sha256" {
407407 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
408408
409409 const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256);
......@@ -419,7 +419,7 @@ test "ECDSA - Basic operations over EcdsaP384Sha256" {
419419 try sig2.verify(msg, kp.public_key);
420420}
421421
422test "ECDSA - Verifying a existing signature with EcdsaP384Sha256" {
422test "Verifying a existing signature with EcdsaP384Sha256" {
423423 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
424424
425425 const Scheme = Ecdsa(crypto.ecc.P384, crypto.hash.sha2.Sha256);
......@@ -463,7 +463,7 @@ const TestVector = struct {
463463 result: enum { valid, invalid, acceptable },
464464};
465465
466test "ECDSA - Test vectors from Project Wycheproof" {
466test "Test vectors from Project Wycheproof" {
467467 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
468468
469469 const vectors = [_]TestVector{
......@@ -877,7 +877,7 @@ fn tvTry(vector: TestVector) !void {
877877 try sig.verify(msg, pk);
878878}
879879
880test "ECDSA - Sec1 encoding/decoding" {
880test "Sec1 encoding/decoding" {
881881 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
882882
883883 const Scheme = EcdsaP384Sha384;
lib/std/crypto/hmac.zig+3-3
......@@ -76,7 +76,7 @@ pub fn Hmac(comptime Hash: type) type {
7676
7777const htest = @import("test.zig");
7878
79test "hmac md5" {
79test "md5" {
8080 var out: [HmacMd5.mac_length]u8 = undefined;
8181 HmacMd5.create(out[0..], "", "");
8282 try htest.assertEqual("74e6f7298a9c2d168935f58c001bad88", out[0..]);
......@@ -85,7 +85,7 @@ test "hmac md5" {
8585 try htest.assertEqual("80070713463e7749b90c2dc24911e275", out[0..]);
8686}
8787
88test "hmac sha1" {
88test "sha1" {
8989 var out: [HmacSha1.mac_length]u8 = undefined;
9090 HmacSha1.create(out[0..], "", "");
9191 try htest.assertEqual("fbdb1d1b18aa6c08324b7d64b71fb76370690e1d", out[0..]);
......@@ -94,7 +94,7 @@ test "hmac sha1" {
9494 try htest.assertEqual("de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9", out[0..]);
9595}
9696
97test "hmac sha256" {
97test "sha256" {
9898 var out: [sha2.HmacSha256.mac_length]u8 = undefined;
9999 sha2.HmacSha256.create(out[0..], "", "");
100100 try htest.assertEqual("b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad", out[0..]);
lib/std/crypto/md5.zig+3-3
......@@ -232,7 +232,7 @@ pub const Md5 = struct {
232232
233233const htest = @import("test.zig");
234234
235test "md5 single" {
235test "single" {
236236 try htest.assertEqualHash(Md5, "d41d8cd98f00b204e9800998ecf8427e", "");
237237 try htest.assertEqualHash(Md5, "0cc175b9c0f1b6a831c399e269772661", "a");
238238 try htest.assertEqualHash(Md5, "900150983cd24fb0d6963f7d28e17f72", "abc");
......@@ -242,7 +242,7 @@ test "md5 single" {
242242 try htest.assertEqualHash(Md5, "57edf4a22be3c955ac49da2e2107b67a", "12345678901234567890123456789012345678901234567890123456789012345678901234567890");
243243}
244244
245test "md5 streaming" {
245test "streaming" {
246246 var h = Md5.init(.{});
247247 var out: [16]u8 = undefined;
248248
......@@ -263,7 +263,7 @@ test "md5 streaming" {
263263 try htest.assertEqual("900150983cd24fb0d6963f7d28e17f72", out[0..]);
264264}
265265
266test "md5 aligned final" {
266test "aligned final" {
267267 var block = [_]u8{0} ** Md5.block_length;
268268 var out: [Md5.digest_length]u8 = undefined;
269269
lib/std/crypto/poly1305.zig+2-2
......@@ -195,7 +195,7 @@ pub const Poly1305 = struct {
195195 }
196196};
197197
198test "poly1305 rfc7439 vector1" {
198test "rfc7439 vector1" {
199199 const expected_mac = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9";
200200
201201 const msg = "Cryptographic Forum Research Group";
......@@ -208,7 +208,7 @@ test "poly1305 rfc7439 vector1" {
208208 try std.testing.expectEqualSlices(u8, expected_mac, &mac);
209209}
210210
211test "poly1305 requiring a final reduction" {
211test "requiring a final reduction" {
212212 const expected_mac = [_]u8{ 25, 13, 249, 42, 164, 57, 99, 60, 149, 181, 74, 74, 13, 63, 121, 6 };
213213 const msg = [_]u8{ 253, 193, 249, 146, 70, 6, 214, 226, 131, 213, 241, 116, 20, 24, 210, 224, 65, 151, 255, 104, 133 };
214214 const key = [_]u8{ 190, 63, 95, 57, 155, 103, 77, 170, 7, 98, 106, 44, 117, 186, 90, 185, 109, 118, 184, 24, 69, 41, 166, 243, 119, 132, 151, 61, 52, 43, 64, 250 };
lib/std/crypto/utils.zig+5-5
......@@ -138,7 +138,7 @@ pub inline fn secureZero(comptime T: type, s: []T) void {
138138 @memset(@as([]volatile T, s), 0);
139139}
140140
141test "crypto.utils.timingSafeEql" {
141test "timingSafeEql" {
142142 var a: [100]u8 = undefined;
143143 var b: [100]u8 = undefined;
144144 random.bytes(a[0..]);
......@@ -148,7 +148,7 @@ test "crypto.utils.timingSafeEql" {
148148 try testing.expect(timingSafeEql([100]u8, a, b));
149149}
150150
151test "crypto.utils.timingSafeEql (vectors)" {
151test "timingSafeEql (vectors)" {
152152 if (@import("builtin").zig_backend == .stage2_x86_64) return error.SkipZigTest;
153153
154154 var a: [100]u8 = undefined;
......@@ -162,7 +162,7 @@ test "crypto.utils.timingSafeEql (vectors)" {
162162 try testing.expect(timingSafeEql(@Vector(100, u8), v1, v3));
163163}
164164
165test "crypto.utils.timingSafeCompare" {
165test "timingSafeCompare" {
166166 var a = [_]u8{10} ** 32;
167167 var b = [_]u8{10} ** 32;
168168 try testing.expectEqual(timingSafeCompare(u8, &a, &b, .big), .eq);
......@@ -175,7 +175,7 @@ test "crypto.utils.timingSafeCompare" {
175175 try testing.expectEqual(timingSafeCompare(u8, &a, &b, .little), .lt);
176176}
177177
178test "crypto.utils.timingSafe{Add,Sub}" {
178test "timingSafe{Add,Sub}" {
179179 const len = 32;
180180 var a: [len]u8 = undefined;
181181 var b: [len]u8 = undefined;
......@@ -195,7 +195,7 @@ test "crypto.utils.timingSafe{Add,Sub}" {
195195 }
196196}
197197
198test "crypto.utils.secureZero" {
198test "secureZero" {
199199 var a = [_]u8{0xfe} ** 8;
200200 var b = [_]u8{0xfe} ** 8;
201201
lib/std/enums.zig+12-12
......@@ -120,7 +120,7 @@ pub fn directEnumArray(
120120 return directEnumArrayDefault(E, Data, null, max_unused_slots, init_values);
121121}
122122
123test "std.enums.directEnumArray" {
123test "directEnumArray" {
124124 const E = enum(i4) { a = 4, b = 6, c = 2 };
125125 var runtime_false: bool = false;
126126 _ = &runtime_false;
......@@ -163,7 +163,7 @@ pub fn directEnumArrayDefault(
163163 return result;
164164}
165165
166test "std.enums.directEnumArrayDefault" {
166test "directEnumArrayDefault" {
167167 const E = enum(i4) { a = 4, b = 6, c = 2 };
168168 var runtime_false: bool = false;
169169 _ = &runtime_false;
......@@ -178,7 +178,7 @@ test "std.enums.directEnumArrayDefault" {
178178 try testing.expectEqual(false, array[2]);
179179}
180180
181test "std.enums.directEnumArrayDefault slice" {
181test "directEnumArrayDefault slice" {
182182 const E = enum(i4) { a = 4, b = 6, c = 2 };
183183 var runtime_b = "b";
184184 _ = &runtime_b;
......@@ -214,7 +214,7 @@ pub fn nameCast(comptime E: type, comptime value: anytype) E {
214214 };
215215}
216216
217test "std.enums.nameCast" {
217test "nameCast" {
218218 const A = enum(u1) { a = 0, b = 1 };
219219 const B = enum(u1) { a = 1, b = 0 };
220220 try testing.expectEqual(A.a, nameCast(A, .a));
......@@ -983,7 +983,7 @@ test "pure EnumSet fns" {
983983 try testing.expect(full.differenceWith(black).eql(red));
984984}
985985
986test "std.enums.EnumSet empty" {
986test "EnumSet empty" {
987987 const E = enum {};
988988 const empty = EnumSet(E).initEmpty();
989989 const full = EnumSet(E).initFull();
......@@ -994,7 +994,7 @@ test "std.enums.EnumSet empty" {
994994 try std.testing.expect(empty.eql(full.complement()));
995995}
996996
997test "std.enums.EnumSet const iterator" {
997test "EnumSet const iterator" {
998998 const Direction = enum { up, down, left, right };
999999 const diag_move = init: {
10001000 var move = EnumSet(Direction).initEmpty();
......@@ -1298,7 +1298,7 @@ pub fn ensureIndexer(comptime T: type) void {
12981298 }
12991299}
13001300
1301test "std.enums.ensureIndexer" {
1301test "ensureIndexer" {
13021302 ensureIndexer(struct {
13031303 pub const Key = u32;
13041304 pub const count: comptime_int = 8;
......@@ -1463,7 +1463,7 @@ test "EnumIndexer non-exhaustive" {
14631463 }
14641464}
14651465
1466test "std.enums.EnumIndexer dense zeroed" {
1466test "EnumIndexer dense zeroed" {
14671467 const E = enum(u2) { b = 1, a = 0, c = 2 };
14681468 const Indexer = EnumIndexer(E);
14691469 ensureIndexer(Indexer);
......@@ -1479,7 +1479,7 @@ test "std.enums.EnumIndexer dense zeroed" {
14791479 try testing.expectEqual(E.c, Indexer.keyForIndex(2));
14801480}
14811481
1482test "std.enums.EnumIndexer dense positive" {
1482test "EnumIndexer dense positive" {
14831483 const E = enum(u4) { c = 6, a = 4, b = 5 };
14841484 const Indexer = EnumIndexer(E);
14851485 ensureIndexer(Indexer);
......@@ -1495,7 +1495,7 @@ test "std.enums.EnumIndexer dense positive" {
14951495 try testing.expectEqual(E.c, Indexer.keyForIndex(2));
14961496}
14971497
1498test "std.enums.EnumIndexer dense negative" {
1498test "EnumIndexer dense negative" {
14991499 const E = enum(i4) { a = -6, c = -4, b = -5 };
15001500 const Indexer = EnumIndexer(E);
15011501 ensureIndexer(Indexer);
......@@ -1511,7 +1511,7 @@ test "std.enums.EnumIndexer dense negative" {
15111511 try testing.expectEqual(E.c, Indexer.keyForIndex(2));
15121512}
15131513
1514test "std.enums.EnumIndexer sparse" {
1514test "EnumIndexer sparse" {
15151515 const E = enum(i4) { a = -2, c = 6, b = 4 };
15161516 const Indexer = EnumIndexer(E);
15171517 ensureIndexer(Indexer);
......@@ -1527,7 +1527,7 @@ test "std.enums.EnumIndexer sparse" {
15271527 try testing.expectEqual(E.c, Indexer.keyForIndex(2));
15281528}
15291529
1530test "std.enums.EnumIndexer empty" {
1530test "EnumIndexer empty" {
15311531 const E = enum {};
15321532 const Indexer = EnumIndexer(E);
15331533 ensureIndexer(Indexer);
lib/std/fmt/parse_float.zig+10-10
......@@ -12,7 +12,7 @@ const epsilon = 1e-7;
1212
1313// See https://github.com/tiehuis/parse-number-fxx-test-data for a wider-selection of test-data.
1414
15test "fmt.parseFloat" {
15test "parseFloat" {
1616 inline for ([_]type{ f16, f32, f64, f128 }) |T| {
1717 try testing.expectError(error.InvalidCharacter, parseFloat(T, ""));
1818 try testing.expectError(error.InvalidCharacter, parseFloat(T, " 1"));
......@@ -68,7 +68,7 @@ test "fmt.parseFloat" {
6868 }
6969}
7070
71test "fmt.parseFloat nan and inf" {
71test "nan and inf" {
7272 inline for ([_]type{ f16, f32, f64, f128 }) |T| {
7373 const Z = std.meta.Int(.unsigned, @typeInfo(T).Float.bits);
7474
......@@ -78,24 +78,24 @@ test "fmt.parseFloat nan and inf" {
7878 }
7979}
8080
81test "fmt.parseFloat largest normals" {
81test "largest normals" {
8282 try expectEqual(@as(u16, @bitCast(try parseFloat(f16, "65504"))), 0x7bff);
8383 try expectEqual(@as(u32, @bitCast(try parseFloat(f32, "3.4028234664E38"))), 0x7f7f_ffff);
8484 try expectEqual(@as(u64, @bitCast(try parseFloat(f64, "1.7976931348623157E308"))), 0x7fef_ffff_ffff_ffff);
8585 try expectEqual(@as(u128, @bitCast(try parseFloat(f128, "1.1897314953572317650857593266280070162E4932"))), 0x7ffe_ffff_ffff_ffff_ffff_ffff_ffff_ffff);
8686}
8787
88test "fmt.parseFloat #11169" {
88test "#11169" {
8989 try expectEqual(try parseFloat(f128, "9007199254740993.0"), 9007199254740993.0);
9090}
9191
92test "fmt.parseFloat hex.special" {
92test "hex.special" {
9393 try testing.expect(math.isNan(try parseFloat(f32, "nAn")));
9494 try testing.expect(math.isPositiveInf(try parseFloat(f32, "iNf")));
9595 try testing.expect(math.isPositiveInf(try parseFloat(f32, "+Inf")));
9696 try testing.expect(math.isNegativeInf(try parseFloat(f32, "-iNf")));
9797}
98test "fmt.parseFloat hex.zero" {
98test "hex.zero" {
9999 try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "0x0"));
100100 try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "-0x0"));
101101 try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "0x0p42"));
......@@ -103,7 +103,7 @@ test "fmt.parseFloat hex.zero" {
103103 try testing.expectEqual(@as(f32, 0.0), try parseFloat(f32, "0x0.00000p666"));
104104}
105105
106test "fmt.parseFloat hex.f16" {
106test "hex.f16" {
107107 try testing.expectEqual(try parseFloat(f16, "0x1p0"), 1.0);
108108 try testing.expectEqual(try parseFloat(f16, "-0x1p-1"), -0.5);
109109 try testing.expectEqual(try parseFloat(f16, "0x10p+10"), 16384.0);
......@@ -119,7 +119,7 @@ test "fmt.parseFloat hex.f16" {
119119 try testing.expectEqual(try parseFloat(f16, "-0x1p-24"), -math.floatTrueMin(f16));
120120}
121121
122test "fmt.parseFloat hex.f32" {
122test "hex.f32" {
123123 try testing.expectError(error.InvalidCharacter, parseFloat(f32, "0x"));
124124 try testing.expectEqual(try parseFloat(f32, "0x1p0"), 1.0);
125125 try testing.expectEqual(try parseFloat(f32, "-0x1p-1"), -0.5);
......@@ -138,7 +138,7 @@ test "fmt.parseFloat hex.f32" {
138138 try testing.expectEqual(try parseFloat(f32, "-0x1P-149"), -math.floatTrueMin(f32));
139139}
140140
141test "fmt.parseFloat hex.f64" {
141test "hex.f64" {
142142 try testing.expectEqual(try parseFloat(f64, "0x1p0"), 1.0);
143143 try testing.expectEqual(try parseFloat(f64, "-0x1p-1"), -0.5);
144144 try testing.expectEqual(try parseFloat(f64, "0x10p+10"), 16384.0);
......@@ -153,7 +153,7 @@ test "fmt.parseFloat hex.f64" {
153153 try testing.expectEqual(try parseFloat(f64, "0x1p-1074"), math.floatTrueMin(f64));
154154 try testing.expectEqual(try parseFloat(f64, "-0x1p-1074"), -math.floatTrueMin(f64));
155155}
156test "fmt.parseFloat hex.f128" {
156test "hex.f128" {
157157 try testing.expectEqual(try parseFloat(f128, "0x1p0"), 1.0);
158158 try testing.expectEqual(try parseFloat(f128, "-0x1p-1"), -0.5);
159159 try testing.expectEqual(try parseFloat(f128, "0x10p+10"), 16384.0);
lib/std/hash_map.zig+23-23
......@@ -1612,7 +1612,7 @@ const testing = std.testing;
16121612const expect = std.testing.expect;
16131613const expectEqual = std.testing.expectEqual;
16141614
1615test "std.hash_map basic usage" {
1615test "basic usage" {
16161616 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
16171617 defer map.deinit();
16181618
......@@ -1640,7 +1640,7 @@ test "std.hash_map basic usage" {
16401640 try expectEqual(total, sum);
16411641}
16421642
1643test "std.hash_map ensureTotalCapacity" {
1643test "ensureTotalCapacity" {
16441644 var map = AutoHashMap(i32, i32).init(std.testing.allocator);
16451645 defer map.deinit();
16461646
......@@ -1655,7 +1655,7 @@ test "std.hash_map ensureTotalCapacity" {
16551655 try testing.expect(initial_capacity == map.capacity());
16561656}
16571657
1658test "std.hash_map ensureUnusedCapacity with tombstones" {
1658test "ensureUnusedCapacity with tombstones" {
16591659 var map = AutoHashMap(i32, i32).init(std.testing.allocator);
16601660 defer map.deinit();
16611661
......@@ -1667,7 +1667,7 @@ test "std.hash_map ensureUnusedCapacity with tombstones" {
16671667 }
16681668}
16691669
1670test "std.hash_map clearRetainingCapacity" {
1670test "clearRetainingCapacity" {
16711671 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
16721672 defer map.deinit();
16731673
......@@ -1692,7 +1692,7 @@ test "std.hash_map clearRetainingCapacity" {
16921692 try expect(!map.contains(1));
16931693}
16941694
1695test "std.hash_map grow" {
1695test "grow" {
16961696 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
16971697 defer map.deinit();
16981698
......@@ -1718,7 +1718,7 @@ test "std.hash_map grow" {
17181718 }
17191719}
17201720
1721test "std.hash_map clone" {
1721test "clone" {
17221722 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
17231723 defer map.deinit();
17241724
......@@ -1756,7 +1756,7 @@ test "std.hash_map clone" {
17561756 }
17571757}
17581758
1759test "std.hash_map ensureTotalCapacity with existing elements" {
1759test "ensureTotalCapacity with existing elements" {
17601760 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
17611761 defer map.deinit();
17621762
......@@ -1769,7 +1769,7 @@ test "std.hash_map ensureTotalCapacity with existing elements" {
17691769 try expectEqual(map.capacity(), 128);
17701770}
17711771
1772test "std.hash_map ensureTotalCapacity satisfies max load factor" {
1772test "ensureTotalCapacity satisfies max load factor" {
17731773 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
17741774 defer map.deinit();
17751775
......@@ -1777,7 +1777,7 @@ test "std.hash_map ensureTotalCapacity satisfies max load factor" {
17771777 try expectEqual(map.capacity(), 256);
17781778}
17791779
1780test "std.hash_map remove" {
1780test "remove" {
17811781 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
17821782 defer map.deinit();
17831783
......@@ -1809,7 +1809,7 @@ test "std.hash_map remove" {
18091809 }
18101810}
18111811
1812test "std.hash_map reverse removes" {
1812test "reverse removes" {
18131813 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
18141814 defer map.deinit();
18151815
......@@ -1831,7 +1831,7 @@ test "std.hash_map reverse removes" {
18311831 try expectEqual(map.count(), 0);
18321832}
18331833
1834test "std.hash_map multiple removes on same metadata" {
1834test "multiple removes on same metadata" {
18351835 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
18361836 defer map.deinit();
18371837
......@@ -1868,7 +1868,7 @@ test "std.hash_map multiple removes on same metadata" {
18681868 }
18691869}
18701870
1871test "std.hash_map put and remove loop in random order" {
1871test "put and remove loop in random order" {
18721872 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
18731873 defer map.deinit();
18741874
......@@ -1900,7 +1900,7 @@ test "std.hash_map put and remove loop in random order" {
19001900 }
19011901}
19021902
1903test "std.hash_map remove one million elements in random order" {
1903test "remove one million elements in random order" {
19041904 const Map = AutoHashMap(u32, u32);
19051905 const n = 1000 * 1000;
19061906 var map = Map.init(std.heap.page_allocator);
......@@ -1930,7 +1930,7 @@ test "std.hash_map remove one million elements in random order" {
19301930 }
19311931}
19321932
1933test "std.hash_map put" {
1933test "put" {
19341934 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
19351935 defer map.deinit();
19361936
......@@ -1955,7 +1955,7 @@ test "std.hash_map put" {
19551955 }
19561956}
19571957
1958test "std.hash_map putAssumeCapacity" {
1958test "putAssumeCapacity" {
19591959 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
19601960 defer map.deinit();
19611961
......@@ -1985,7 +1985,7 @@ test "std.hash_map putAssumeCapacity" {
19851985 try expectEqual(sum, 20);
19861986}
19871987
1988test "std.hash_map repeat putAssumeCapacity/remove" {
1988test "repeat putAssumeCapacity/remove" {
19891989 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
19901990 defer map.deinit();
19911991
......@@ -2017,7 +2017,7 @@ test "std.hash_map repeat putAssumeCapacity/remove" {
20172017 try expectEqual(map.unmanaged.count(), limit);
20182018}
20192019
2020test "std.hash_map getOrPut" {
2020test "getOrPut" {
20212021 var map = AutoHashMap(u32, u32).init(std.testing.allocator);
20222022 defer map.deinit();
20232023
......@@ -2040,7 +2040,7 @@ test "std.hash_map getOrPut" {
20402040 try expectEqual(sum, 30);
20412041}
20422042
2043test "std.hash_map basic hash map usage" {
2043test "basic hash map usage" {
20442044 var map = AutoHashMap(i32, i32).init(std.testing.allocator);
20452045 defer map.deinit();
20462046
......@@ -2085,7 +2085,7 @@ test "std.hash_map basic hash map usage" {
20852085 try testing.expect(map.remove(3) == true);
20862086}
20872087
2088test "std.hash_map getOrPutAdapted" {
2088test "getOrPutAdapted" {
20892089 const AdaptedContext = struct {
20902090 fn eql(self: @This(), adapted_key: []const u8, test_key: u64) bool {
20912091 _ = self;
......@@ -2134,7 +2134,7 @@ test "std.hash_map getOrPutAdapted" {
21342134 }
21352135}
21362136
2137test "std.hash_map ensureUnusedCapacity" {
2137test "ensureUnusedCapacity" {
21382138 var map = AutoHashMap(u64, u64).init(testing.allocator);
21392139 defer map.deinit();
21402140
......@@ -2147,7 +2147,7 @@ test "std.hash_map ensureUnusedCapacity" {
21472147 try testing.expectEqual(capacity, map.capacity());
21482148}
21492149
2150test "std.hash_map removeByPtr" {
2150test "removeByPtr" {
21512151 var map = AutoHashMap(i32, u64).init(testing.allocator);
21522152 defer map.deinit();
21532153
......@@ -2173,7 +2173,7 @@ test "std.hash_map removeByPtr" {
21732173 try testing.expect(map.count() == 0);
21742174}
21752175
2176test "std.hash_map removeByPtr 0 sized key" {
2176test "removeByPtr 0 sized key" {
21772177 var map = AutoHashMap(u0, u64).init(testing.allocator);
21782178 defer map.deinit();
21792179
......@@ -2191,7 +2191,7 @@ test "std.hash_map removeByPtr 0 sized key" {
21912191 try testing.expect(map.count() == 0);
21922192}
21932193
2194test "std.hash_map repeat fetchRemove" {
2194test "repeat fetchRemove" {
21952195 var map = AutoHashMapUnmanaged(u64, void){};
21962196 defer map.deinit(testing.allocator);
21972197
lib/std/heap/arena_allocator.zig+2-2
......@@ -246,7 +246,7 @@ pub const ArenaAllocator = struct {
246246 }
247247};
248248
249test "ArenaAllocator (reset with preheating)" {
249test "reset with preheating" {
250250 var arena_allocator = ArenaAllocator.init(std.testing.allocator);
251251 defer arena_allocator.deinit();
252252 // provides some variance in the allocated data
......@@ -269,7 +269,7 @@ test "ArenaAllocator (reset with preheating)" {
269269 }
270270}
271271
272test "ArenaAllocator (reset while retaining a buffer)" {
272test "reset while retaining a buffer" {
273273 var arena_allocator = ArenaAllocator.init(std.testing.allocator);
274274 defer arena_allocator.deinit();
275275 const a = arena_allocator.allocator();
lib/std/heap/memory_pool.zig+6-6
......@@ -145,7 +145,7 @@ pub fn MemoryPoolExtra(comptime Item: type, comptime pool_options: Options) type
145145 };
146146}
147147
148test "memory pool: basic" {
148test "basic" {
149149 var pool = MemoryPool(u32).init(std.testing.allocator);
150150 defer pool.deinit();
151151
......@@ -165,7 +165,7 @@ test "memory pool: basic" {
165165 try std.testing.expect(p2 == p4);
166166}
167167
168test "memory pool: preheating (success)" {
168test "preheating (success)" {
169169 var pool = try MemoryPool(u32).initPreheated(std.testing.allocator, 4);
170170 defer pool.deinit();
171171
......@@ -174,12 +174,12 @@ test "memory pool: preheating (success)" {
174174 _ = try pool.create();
175175}
176176
177test "memory pool: preheating (failure)" {
177test "preheating (failure)" {
178178 const failer = std.testing.failing_allocator;
179179 try std.testing.expectError(error.OutOfMemory, MemoryPool(u32).initPreheated(failer, 5));
180180}
181181
182test "memory pool: growable" {
182test "growable" {
183183 var pool = try MemoryPoolExtra(u32, .{ .growable = false }).initPreheated(std.testing.allocator, 4);
184184 defer pool.deinit();
185185
......@@ -191,7 +191,7 @@ test "memory pool: growable" {
191191 try std.testing.expectError(error.OutOfMemory, pool.create());
192192}
193193
194test "memory pool: greater than pointer default alignment" {
194test "greater than pointer default alignment" {
195195 const Foo = struct {
196196 data: u64 align(16),
197197 };
......@@ -203,7 +203,7 @@ test "memory pool: greater than pointer default alignment" {
203203 _ = foo;
204204}
205205
206test "memory pool: greater than pointer manual alignment" {
206test "greater than pointer manual alignment" {
207207 const Foo = struct {
208208 data: u64,
209209 };
lib/std/io/Reader/test.zig+33-33
......@@ -15,14 +15,14 @@ test "Reader" {
1515 try testing.expectError(error.EndOfStream, reader.readByte());
1616}
1717
18test "Reader.isBytes" {
18test "isBytes" {
1919 var fis = std.io.fixedBufferStream("foobar");
2020 const reader = fis.reader();
2121 try testing.expectEqual(true, try reader.isBytes("foo"));
2222 try testing.expectEqual(false, try reader.isBytes("qux"));
2323}
2424
25test "Reader.skipBytes" {
25test "skipBytes" {
2626 var fis = std.io.fixedBufferStream("foobar");
2727 const reader = fis.reader();
2828 try reader.skipBytes(3, .{});
......@@ -31,7 +31,7 @@ test "Reader.skipBytes" {
3131 try testing.expectError(error.EndOfStream, reader.skipBytes(1, .{}));
3232}
3333
34test "Reader.readUntilDelimiterArrayList returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
34test "readUntilDelimiterArrayList returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
3535 const a = std.testing.allocator;
3636 var list = std.ArrayList(u8).init(a);
3737 defer list.deinit();
......@@ -46,7 +46,7 @@ test "Reader.readUntilDelimiterArrayList returns ArrayLists with bytes read unti
4646 try std.testing.expectError(error.EndOfStream, reader.readUntilDelimiterArrayList(&list, '\n', 5));
4747}
4848
49test "Reader.readUntilDelimiterArrayList returns an empty ArrayList" {
49test "readUntilDelimiterArrayList returns an empty ArrayList" {
5050 const a = std.testing.allocator;
5151 var list = std.ArrayList(u8).init(a);
5252 defer list.deinit();
......@@ -58,7 +58,7 @@ test "Reader.readUntilDelimiterArrayList returns an empty ArrayList" {
5858 try std.testing.expectEqualStrings("", list.items);
5959}
6060
61test "Reader.readUntilDelimiterArrayList returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
61test "readUntilDelimiterArrayList returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
6262 const a = std.testing.allocator;
6363 var list = std.ArrayList(u8).init(a);
6464 defer list.deinit();
......@@ -72,7 +72,7 @@ test "Reader.readUntilDelimiterArrayList returns StreamTooLong, then an ArrayLis
7272 try std.testing.expectEqualStrings("67", list.items);
7373}
7474
75test "Reader.readUntilDelimiterArrayList returns EndOfStream" {
75test "readUntilDelimiterArrayList returns EndOfStream" {
7676 const a = std.testing.allocator;
7777 var list = std.ArrayList(u8).init(a);
7878 defer list.deinit();
......@@ -84,7 +84,7 @@ test "Reader.readUntilDelimiterArrayList returns EndOfStream" {
8484 try std.testing.expectEqualStrings("1234", list.items);
8585}
8686
87test "Reader.readUntilDelimiterAlloc returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
87test "readUntilDelimiterAlloc returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
8888 const a = std.testing.allocator;
8989
9090 var fis = std.io.fixedBufferStream("0000\n1234\n");
......@@ -105,7 +105,7 @@ test "Reader.readUntilDelimiterAlloc returns ArrayLists with bytes read until th
105105 try std.testing.expectError(error.EndOfStream, reader.readUntilDelimiterAlloc(a, '\n', 5));
106106}
107107
108test "Reader.readUntilDelimiterAlloc returns an empty ArrayList" {
108test "readUntilDelimiterAlloc returns an empty ArrayList" {
109109 const a = std.testing.allocator;
110110
111111 var fis = std.io.fixedBufferStream("\n");
......@@ -118,7 +118,7 @@ test "Reader.readUntilDelimiterAlloc returns an empty ArrayList" {
118118 }
119119}
120120
121test "Reader.readUntilDelimiterAlloc returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
121test "readUntilDelimiterAlloc returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
122122 const a = std.testing.allocator;
123123
124124 var fis = std.io.fixedBufferStream("1234567\n");
......@@ -131,7 +131,7 @@ test "Reader.readUntilDelimiterAlloc returns StreamTooLong, then an ArrayList wi
131131 try std.testing.expectEqualStrings("67", result);
132132}
133133
134test "Reader.readUntilDelimiterAlloc returns EndOfStream" {
134test "readUntilDelimiterAlloc returns EndOfStream" {
135135 const a = std.testing.allocator;
136136
137137 var fis = std.io.fixedBufferStream("1234");
......@@ -140,7 +140,7 @@ test "Reader.readUntilDelimiterAlloc returns EndOfStream" {
140140 try std.testing.expectError(error.EndOfStream, reader.readUntilDelimiterAlloc(a, '\n', 5));
141141}
142142
143test "Reader.readUntilDelimiter returns bytes read until the delimiter" {
143test "readUntilDelimiter returns bytes read until the delimiter" {
144144 var buf: [5]u8 = undefined;
145145 var fis = std.io.fixedBufferStream("0000\n1234\n");
146146 const reader = fis.reader();
......@@ -148,14 +148,14 @@ test "Reader.readUntilDelimiter returns bytes read until the delimiter" {
148148 try std.testing.expectEqualStrings("1234", try reader.readUntilDelimiter(&buf, '\n'));
149149}
150150
151test "Reader.readUntilDelimiter returns an empty string" {
151test "readUntilDelimiter returns an empty string" {
152152 var buf: [5]u8 = undefined;
153153 var fis = std.io.fixedBufferStream("\n");
154154 const reader = fis.reader();
155155 try std.testing.expectEqualStrings("", try reader.readUntilDelimiter(&buf, '\n'));
156156}
157157
158test "Reader.readUntilDelimiter returns StreamTooLong, then an empty string" {
158test "readUntilDelimiter returns StreamTooLong, then an empty string" {
159159 var buf: [5]u8 = undefined;
160160 var fis = std.io.fixedBufferStream("12345\n");
161161 const reader = fis.reader();
......@@ -163,7 +163,7 @@ test "Reader.readUntilDelimiter returns StreamTooLong, then an empty string" {
163163 try std.testing.expectEqualStrings("", try reader.readUntilDelimiter(&buf, '\n'));
164164}
165165
166test "Reader.readUntilDelimiter returns StreamTooLong, then bytes read until the delimiter" {
166test "readUntilDelimiter returns StreamTooLong, then bytes read until the delimiter" {
167167 var buf: [5]u8 = undefined;
168168 var fis = std.io.fixedBufferStream("1234567\n");
169169 const reader = fis.reader();
......@@ -171,7 +171,7 @@ test "Reader.readUntilDelimiter returns StreamTooLong, then bytes read until the
171171 try std.testing.expectEqualStrings("67", try reader.readUntilDelimiter(&buf, '\n'));
172172}
173173
174test "Reader.readUntilDelimiter returns EndOfStream" {
174test "readUntilDelimiter returns EndOfStream" {
175175 {
176176 var buf: [5]u8 = undefined;
177177 var fis = std.io.fixedBufferStream("");
......@@ -186,7 +186,7 @@ test "Reader.readUntilDelimiter returns EndOfStream" {
186186 }
187187}
188188
189test "Reader.readUntilDelimiter returns bytes read until delimiter, then EndOfStream" {
189test "readUntilDelimiter returns bytes read until delimiter, then EndOfStream" {
190190 var buf: [5]u8 = undefined;
191191 var fis = std.io.fixedBufferStream("1234\n");
192192 const reader = fis.reader();
......@@ -194,7 +194,7 @@ test "Reader.readUntilDelimiter returns bytes read until delimiter, then EndOfSt
194194 try std.testing.expectError(error.EndOfStream, reader.readUntilDelimiter(&buf, '\n'));
195195}
196196
197test "Reader.readUntilDelimiter returns StreamTooLong, then EndOfStream" {
197test "readUntilDelimiter returns StreamTooLong, then EndOfStream" {
198198 var buf: [5]u8 = undefined;
199199 var fis = std.io.fixedBufferStream("12345");
200200 const reader = fis.reader();
......@@ -202,7 +202,7 @@ test "Reader.readUntilDelimiter returns StreamTooLong, then EndOfStream" {
202202 try std.testing.expectError(error.EndOfStream, reader.readUntilDelimiter(&buf, '\n'));
203203}
204204
205test "Reader.readUntilDelimiter writes all bytes read to the output buffer" {
205test "readUntilDelimiter writes all bytes read to the output buffer" {
206206 var buf: [5]u8 = undefined;
207207 var fis = std.io.fixedBufferStream("0000\n12345");
208208 const reader = fis.reader();
......@@ -212,7 +212,7 @@ test "Reader.readUntilDelimiter writes all bytes read to the output buffer" {
212212 try std.testing.expectEqualStrings("12345", &buf);
213213}
214214
215test "Reader.readUntilDelimiterOrEofAlloc returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
215test "readUntilDelimiterOrEofAlloc returns ArrayLists with bytes read until the delimiter, then EndOfStream" {
216216 const a = std.testing.allocator;
217217
218218 var fis = std.io.fixedBufferStream("0000\n1234\n");
......@@ -233,7 +233,7 @@ test "Reader.readUntilDelimiterOrEofAlloc returns ArrayLists with bytes read unt
233233 try std.testing.expect((try reader.readUntilDelimiterOrEofAlloc(a, '\n', 5)) == null);
234234}
235235
236test "Reader.readUntilDelimiterOrEofAlloc returns an empty ArrayList" {
236test "readUntilDelimiterOrEofAlloc returns an empty ArrayList" {
237237 const a = std.testing.allocator;
238238
239239 var fis = std.io.fixedBufferStream("\n");
......@@ -246,7 +246,7 @@ test "Reader.readUntilDelimiterOrEofAlloc returns an empty ArrayList" {
246246 }
247247}
248248
249test "Reader.readUntilDelimiterOrEofAlloc returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
249test "readUntilDelimiterOrEofAlloc returns StreamTooLong, then an ArrayList with bytes read until the delimiter" {
250250 const a = std.testing.allocator;
251251
252252 var fis = std.io.fixedBufferStream("1234567\n");
......@@ -259,7 +259,7 @@ test "Reader.readUntilDelimiterOrEofAlloc returns StreamTooLong, then an ArrayLi
259259 try std.testing.expectEqualStrings("67", result);
260260}
261261
262test "Reader.readUntilDelimiterOrEof returns bytes read until the delimiter" {
262test "readUntilDelimiterOrEof returns bytes read until the delimiter" {
263263 var buf: [5]u8 = undefined;
264264 var fis = std.io.fixedBufferStream("0000\n1234\n");
265265 const reader = fis.reader();
......@@ -267,14 +267,14 @@ test "Reader.readUntilDelimiterOrEof returns bytes read until the delimiter" {
267267 try std.testing.expectEqualStrings("1234", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
268268}
269269
270test "Reader.readUntilDelimiterOrEof returns an empty string" {
270test "readUntilDelimiterOrEof returns an empty string" {
271271 var buf: [5]u8 = undefined;
272272 var fis = std.io.fixedBufferStream("\n");
273273 const reader = fis.reader();
274274 try std.testing.expectEqualStrings("", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
275275}
276276
277test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then an empty string" {
277test "readUntilDelimiterOrEof returns StreamTooLong, then an empty string" {
278278 var buf: [5]u8 = undefined;
279279 var fis = std.io.fixedBufferStream("12345\n");
280280 const reader = fis.reader();
......@@ -282,7 +282,7 @@ test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then an empty string
282282 try std.testing.expectEqualStrings("", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
283283}
284284
285test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then bytes read until the delimiter" {
285test "readUntilDelimiterOrEof returns StreamTooLong, then bytes read until the delimiter" {
286286 var buf: [5]u8 = undefined;
287287 var fis = std.io.fixedBufferStream("1234567\n");
288288 const reader = fis.reader();
......@@ -290,14 +290,14 @@ test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then bytes read unti
290290 try std.testing.expectEqualStrings("67", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
291291}
292292
293test "Reader.readUntilDelimiterOrEof returns null" {
293test "readUntilDelimiterOrEof returns null" {
294294 var buf: [5]u8 = undefined;
295295 var fis = std.io.fixedBufferStream("");
296296 const reader = fis.reader();
297297 try std.testing.expect((try reader.readUntilDelimiterOrEof(&buf, '\n')) == null);
298298}
299299
300test "Reader.readUntilDelimiterOrEof returns bytes read until delimiter, then null" {
300test "readUntilDelimiterOrEof returns bytes read until delimiter, then null" {
301301 var buf: [5]u8 = undefined;
302302 var fis = std.io.fixedBufferStream("1234\n");
303303 const reader = fis.reader();
......@@ -305,14 +305,14 @@ test "Reader.readUntilDelimiterOrEof returns bytes read until delimiter, then nu
305305 try std.testing.expect((try reader.readUntilDelimiterOrEof(&buf, '\n')) == null);
306306}
307307
308test "Reader.readUntilDelimiterOrEof returns bytes read until end-of-stream" {
308test "readUntilDelimiterOrEof returns bytes read until end-of-stream" {
309309 var buf: [5]u8 = undefined;
310310 var fis = std.io.fixedBufferStream("1234");
311311 const reader = fis.reader();
312312 try std.testing.expectEqualStrings("1234", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
313313}
314314
315test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then bytes read until end-of-stream" {
315test "readUntilDelimiterOrEof returns StreamTooLong, then bytes read until end-of-stream" {
316316 var buf: [5]u8 = undefined;
317317 var fis = std.io.fixedBufferStream("1234567");
318318 const reader = fis.reader();
......@@ -320,7 +320,7 @@ test "Reader.readUntilDelimiterOrEof returns StreamTooLong, then bytes read unti
320320 try std.testing.expectEqualStrings("67", (try reader.readUntilDelimiterOrEof(&buf, '\n')).?);
321321}
322322
323test "Reader.readUntilDelimiterOrEof writes all bytes read to the output buffer" {
323test "readUntilDelimiterOrEof writes all bytes read to the output buffer" {
324324 var buf: [5]u8 = undefined;
325325 var fis = std.io.fixedBufferStream("0000\n12345");
326326 const reader = fis.reader();
......@@ -330,7 +330,7 @@ test "Reader.readUntilDelimiterOrEof writes all bytes read to the output buffer"
330330 try std.testing.expectEqualStrings("12345", &buf);
331331}
332332
333test "Reader.streamUntilDelimiter writes all bytes without delimiter to the output" {
333test "streamUntilDelimiter writes all bytes without delimiter to the output" {
334334 const input_string = "some_string_with_delimiter!";
335335 var input_fbs = std.io.fixedBufferStream(input_string);
336336 const reader = input_fbs.reader();
......@@ -349,7 +349,7 @@ test "Reader.streamUntilDelimiter writes all bytes without delimiter to the outp
349349 try std.testing.expectError(error.StreamTooLong, reader.streamUntilDelimiter(writer, '!', 5));
350350}
351351
352test "Reader.readBoundedBytes correctly reads into a new bounded array" {
352test "readBoundedBytes correctly reads into a new bounded array" {
353353 const test_string = "abcdefg";
354354 var fis = std.io.fixedBufferStream(test_string);
355355 const reader = fis.reader();
......@@ -358,7 +358,7 @@ test "Reader.readBoundedBytes correctly reads into a new bounded array" {
358358 try testing.expectEqualStrings(array.slice(), test_string);
359359}
360360
361test "Reader.readIntoBoundedBytes correctly reads into a provided bounded array" {
361test "readIntoBoundedBytes correctly reads into a provided bounded array" {
362362 const test_string = "abcdefg";
363363 var fis = std.io.fixedBufferStream(test_string);
364364 const reader = fis.reader();
lib/std/io/buffered_reader.zig+2-2
......@@ -53,7 +53,7 @@ pub fn bufferedReaderSize(comptime size: usize, reader: anytype) BufferedReader(
5353 return .{ .unbuffered_reader = reader };
5454}
5555
56test "io.BufferedReader OneByte" {
56test "OneByte" {
5757 const OneByteReadReader = struct {
5858 str: []const u8,
5959 curr: usize,
......@@ -96,7 +96,7 @@ test "io.BufferedReader OneByte" {
9696fn smallBufferedReader(underlying_stream: anytype) BufferedReader(8, @TypeOf(underlying_stream)) {
9797 return .{ .unbuffered_reader = underlying_stream };
9898}
99test "io.BufferedReader Block" {
99test "Block" {
100100 const BlockReader = struct {
101101 block: []const u8,
102102 reads_allowed: usize,
lib/std/io/buffered_tee.zig+5-5
......@@ -146,7 +146,7 @@ fn bufferedReader(reader: anytype) BufferedReader(4096, @TypeOf(reader)) {
146146 };
147147}
148148
149test "io.BufferedTee io.BufferedReader OneByte" {
149test "OneByte" {
150150 const OneByteReadReader = struct {
151151 str: []const u8,
152152 curr: usize,
......@@ -186,7 +186,7 @@ test "io.BufferedTee io.BufferedReader OneByte" {
186186 try testing.expectEqualSlices(u8, str, res);
187187}
188188
189test "io.BufferedTee io.BufferedReader Block" {
189test "Block" {
190190 const BlockReader = struct {
191191 block: []const u8,
192192 reads_allowed: usize,
......@@ -289,7 +289,7 @@ test "io.BufferedTee io.BufferedReader Block" {
289289 }
290290}
291291
292test "io.BufferedTee with zero lookahead" {
292test "with zero lookahead" {
293293 // output has same bytes as consumer
294294 const data = [_]u8{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ** 12;
295295 var in = io.fixedBufferStream(&data);
......@@ -308,7 +308,7 @@ test "io.BufferedTee with zero lookahead" {
308308 }
309309}
310310
311test "io.BufferedTee with lookahead" {
311test "with lookahead" {
312312 // output is lookahead bytes behind consumer
313313 inline for (1..8) |lookahead| {
314314 const data = [_]u8{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ** 12;
......@@ -333,7 +333,7 @@ test "io.BufferedTee with lookahead" {
333333 }
334334}
335335
336test "io.BufferedTee internal state" {
336test "internal state" {
337337 const data = [_]u8{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } ** 2;
338338 var in = io.fixedBufferStream(&data);
339339 var out = std.ArrayList(u8).init(testing.allocator);
lib/std/io/counting_reader.zig+1-1
......@@ -27,7 +27,7 @@ pub fn countingReader(reader: anytype) CountingReader(@TypeOf(reader)) {
2727 return .{ .child_reader = reader };
2828}
2929
30test "io.CountingReader" {
30test CountingReader {
3131 const bytes = "yay" ** 100;
3232 var fbs = io.fixedBufferStream(bytes);
3333
lib/std/io/counting_writer.zig+1-1
......@@ -29,7 +29,7 @@ pub fn countingWriter(child_stream: anytype) CountingWriter(@TypeOf(child_stream
2929 return .{ .bytes_written = 0, .child_stream = child_stream };
3030}
3131
32test "io.CountingWriter" {
32test CountingWriter {
3333 var counting_stream = countingWriter(std.io.null_writer);
3434 const stream = counting_stream.writer();
3535
lib/std/io/fixed_buffer_stream.zig+4-4
......@@ -132,7 +132,7 @@ fn Slice(comptime T: type) type {
132132 }
133133}
134134
135test "FixedBufferStream output" {
135test "output" {
136136 var buf: [255]u8 = undefined;
137137 var fbs = fixedBufferStream(&buf);
138138 const stream = fbs.writer();
......@@ -141,7 +141,7 @@ test "FixedBufferStream output" {
141141 try testing.expectEqualSlices(u8, "HelloWorld!", fbs.getWritten());
142142}
143143
144test "FixedBufferStream output at comptime" {
144test "output at comptime" {
145145 comptime {
146146 var buf: [255]u8 = undefined;
147147 var fbs = fixedBufferStream(&buf);
......@@ -152,7 +152,7 @@ test "FixedBufferStream output at comptime" {
152152 }
153153}
154154
155test "FixedBufferStream output 2" {
155test "output 2" {
156156 var buffer: [10]u8 = undefined;
157157 var fbs = fixedBufferStream(&buffer);
158158
......@@ -175,7 +175,7 @@ test "FixedBufferStream output 2" {
175175 try testing.expectError(error.NoSpaceLeft, fbs.writer().writeAll("H"));
176176}
177177
178test "FixedBufferStream input" {
178test "input" {
179179 const bytes = [_]u8{ 1, 2, 3, 4, 5, 6, 7 };
180180 var fbs = fixedBufferStream(&bytes);
181181
lib/std/io/stream_source.zig+3-3
......@@ -99,11 +99,11 @@ pub const StreamSource = union(enum) {
9999 }
100100};
101101
102test "StreamSource (refs)" {
102test "refs" {
103103 std.testing.refAllDecls(StreamSource);
104104}
105105
106test "StreamSource (mutable buffer)" {
106test "mutable buffer" {
107107 var buffer: [64]u8 = undefined;
108108 var source = StreamSource{ .buffer = std.io.fixedBufferStream(&buffer) };
109109
......@@ -114,7 +114,7 @@ test "StreamSource (mutable buffer)" {
114114 try std.testing.expectEqualStrings("Hello, World!", source.buffer.getWritten());
115115}
116116
117test "StreamSource (const buffer)" {
117test "const buffer" {
118118 const buffer: [64]u8 = "Hello, World!".* ++ ([1]u8{0xAA} ** 51);
119119 var source = StreamSource{ .const_buffer = std.io.fixedBufferStream(&buffer) };
120120
lib/std/json/scanner_test.zig+4-4
......@@ -35,7 +35,7 @@ fn expectPeekNext(scanner_or_reader: anytype, expected_token_type: TokenType, ex
3535 try expectEqualTokens(expected_token, try scanner_or_reader.next());
3636}
3737
38test "json.token" {
38test "token" {
3939 var scanner = JsonScanner.initCompleteInput(std.testing.allocator, example_document_str);
4040 defer scanner.deinit();
4141
......@@ -153,7 +153,7 @@ test "peek all types" {
153153 try testAllTypes(&tiny_json_reader, false);
154154}
155155
156test "json.token mismatched close" {
156test "token mismatched close" {
157157 var scanner = JsonScanner.initCompleteInput(std.testing.allocator, "[102, 111, 111 }");
158158 defer scanner.deinit();
159159 try expectNext(&scanner, .array_begin);
......@@ -163,7 +163,7 @@ test "json.token mismatched close" {
163163 try std.testing.expectError(error.SyntaxError, scanner.next());
164164}
165165
166test "json.token premature object close" {
166test "token premature object close" {
167167 var scanner = JsonScanner.initCompleteInput(std.testing.allocator, "{ \"key\": }");
168168 defer scanner.deinit();
169169 try expectNext(&scanner, .object_begin);
......@@ -353,7 +353,7 @@ test "BufferUnderrun" {
353353 }
354354}
355355
356test "json.validate" {
356test "validate" {
357357 try std.testing.expectEqual(true, try validate(std.testing.allocator, "{}"));
358358 try std.testing.expectEqual(true, try validate(std.testing.allocator, "[]"));
359359 try std.testing.expectEqual(false, try validate(std.testing.allocator, "[{[[[[{}]]]]}]"));
lib/std/math.zig+1-1
......@@ -1298,7 +1298,7 @@ pub fn log2_int_ceil(comptime T: type, x: T) Log2IntCeil(T) {
12981298 return log2_val + 1;
12991299}
13001300
1301test "std.math.log2_int_ceil" {
1301test log2_int_ceil {
13021302 try testing.expect(log2_int_ceil(u32, 1) == 0);
13031303 try testing.expect(log2_int_ceil(u32, 2) == 1);
13041304 try testing.expect(log2_int_ceil(u32, 3) == 2);
lib/std/math/acos.zig+5-5
......@@ -148,12 +148,12 @@ fn acos64(x: f64) f64 {
148148 return 2 * (df + w);
149149}
150150
151test "math.acos" {
151test "acos" {
152152 try expect(acos(@as(f32, 0.0)) == acos32(0.0));
153153 try expect(acos(@as(f64, 0.0)) == acos64(0.0));
154154}
155155
156test "math.acos32" {
156test "acos32" {
157157 const epsilon = 0.000001;
158158
159159 try expect(math.approxEqAbs(f32, acos32(0.0), 1.570796, epsilon));
......@@ -164,7 +164,7 @@ test "math.acos32" {
164164 try expect(math.approxEqAbs(f32, acos32(-0.2), 1.772154, epsilon));
165165}
166166
167test "math.acos64" {
167test "acos64" {
168168 const epsilon = 0.000001;
169169
170170 try expect(math.approxEqAbs(f64, acos64(0.0), 1.570796, epsilon));
......@@ -175,12 +175,12 @@ test "math.acos64" {
175175 try expect(math.approxEqAbs(f64, acos64(-0.2), 1.772154, epsilon));
176176}
177177
178test "math.acos32.special" {
178test "acos32.special" {
179179 try expect(math.isNan(acos32(-2)));
180180 try expect(math.isNan(acos32(1.5)));
181181}
182182
183test "math.acos64.special" {
183test "acos64.special" {
184184 try expect(math.isNan(acos64(-2)));
185185 try expect(math.isNan(acos64(1.5)));
186186}
lib/std/math/acosh.zig+5-5
......@@ -59,12 +59,12 @@ fn acosh64(x: f64) f64 {
5959 }
6060}
6161
62test "math.acosh" {
62test "acosh" {
6363 try expect(acosh(@as(f32, 1.5)) == acosh32(1.5));
6464 try expect(acosh(@as(f64, 1.5)) == acosh64(1.5));
6565}
6666
67test "math.acosh32" {
67test "acosh32" {
6868 const epsilon = 0.000001;
6969
7070 try expect(math.approxEqAbs(f32, acosh32(1.5), 0.962424, epsilon));
......@@ -73,7 +73,7 @@ test "math.acosh32" {
7373 try expect(math.approxEqAbs(f32, acosh32(123123.234375), 12.414088, epsilon));
7474}
7575
76test "math.acosh64" {
76test "acosh64" {
7777 const epsilon = 0.000001;
7878
7979 try expect(math.approxEqAbs(f64, acosh64(1.5), 0.962424, epsilon));
......@@ -82,12 +82,12 @@ test "math.acosh64" {
8282 try expect(math.approxEqAbs(f64, acosh64(123123.234375), 12.414088, epsilon));
8383}
8484
85test "math.acosh32.special" {
85test "acosh32.special" {
8686 try expect(math.isNan(acosh32(math.nan(f32))));
8787 try expect(math.isNan(acosh32(0.5)));
8888}
8989
90test "math.acosh64.special" {
90test "acosh64.special" {
9191 try expect(math.isNan(acosh64(math.nan(f64))));
9292 try expect(math.isNan(acosh64(0.5)));
9393}
lib/std/math/asin.zig+5-5
......@@ -141,12 +141,12 @@ fn asin64(x: f64) f64 {
141141 }
142142}
143143
144test "math.asin" {
144test "asin" {
145145 try expect(asin(@as(f32, 0.0)) == asin32(0.0));
146146 try expect(asin(@as(f64, 0.0)) == asin64(0.0));
147147}
148148
149test "math.asin32" {
149test "asin32" {
150150 const epsilon = 0.000001;
151151
152152 try expect(math.approxEqAbs(f32, asin32(0.0), 0.0, epsilon));
......@@ -157,7 +157,7 @@ test "math.asin32" {
157157 try expect(math.approxEqAbs(f32, asin32(0.8923), 1.102415, epsilon));
158158}
159159
160test "math.asin64" {
160test "asin64" {
161161 const epsilon = 0.000001;
162162
163163 try expect(math.approxEqAbs(f64, asin64(0.0), 0.0, epsilon));
......@@ -168,14 +168,14 @@ test "math.asin64" {
168168 try expect(math.approxEqAbs(f64, asin64(0.8923), 1.102415, epsilon));
169169}
170170
171test "math.asin32.special" {
171test "asin32.special" {
172172 try expect(math.isPositiveZero(asin32(0.0)));
173173 try expect(math.isNegativeZero(asin32(-0.0)));
174174 try expect(math.isNan(asin32(-2)));
175175 try expect(math.isNan(asin32(1.5)));
176176}
177177
178test "math.asin64.special" {
178test "asin64.special" {
179179 try expect(math.isPositiveZero(asin64(0.0)));
180180 try expect(math.isNegativeZero(asin64(-0.0)));
181181 try expect(math.isNan(asin64(-2)));
lib/std/math/asinh.zig+5-5
......@@ -80,12 +80,12 @@ fn asinh64(x: f64) f64 {
8080 return if (s != 0) -rx else rx;
8181}
8282
83test "math.asinh" {
83test "asinh" {
8484 try expect(asinh(@as(f32, 0.0)) == asinh32(0.0));
8585 try expect(asinh(@as(f64, 0.0)) == asinh64(0.0));
8686}
8787
88test "math.asinh32" {
88test "asinh32" {
8989 const epsilon = 0.000001;
9090
9191 try expect(math.approxEqAbs(f32, asinh32(0.0), 0.0, epsilon));
......@@ -98,7 +98,7 @@ test "math.asinh32" {
9898 try expect(math.approxEqAbs(f32, asinh32(123123.234375), 12.414088, epsilon));
9999}
100100
101test "math.asinh64" {
101test "asinh64" {
102102 const epsilon = 0.000001;
103103
104104 try expect(math.approxEqAbs(f64, asinh64(0.0), 0.0, epsilon));
......@@ -111,7 +111,7 @@ test "math.asinh64" {
111111 try expect(math.approxEqAbs(f64, asinh64(123123.234375), 12.414088, epsilon));
112112}
113113
114test "math.asinh32.special" {
114test "asinh32.special" {
115115 try expect(math.isPositiveZero(asinh32(0.0)));
116116 try expect(math.isNegativeZero(asinh32(-0.0)));
117117 try expect(math.isPositiveInf(asinh32(math.inf(f32))));
......@@ -119,7 +119,7 @@ test "math.asinh32.special" {
119119 try expect(math.isNan(asinh32(math.nan(f32))));
120120}
121121
122test "math.asinh64.special" {
122test "asinh64.special" {
123123 try expect(math.isPositiveZero(asinh64(0.0)));
124124 try expect(math.isNegativeZero(asinh64(-0.0)));
125125 try expect(math.isPositiveInf(asinh64(math.inf(f64))));
lib/std/math/atan.zig+5-5
......@@ -212,12 +212,12 @@ fn atan64(x_: f64) f64 {
212212 }
213213}
214214
215test "math.atan" {
215test "atan" {
216216 try expect(@as(u32, @bitCast(atan(@as(f32, 0.2)))) == @as(u32, @bitCast(atan32(0.2))));
217217 try expect(atan(@as(f64, 0.2)) == atan64(0.2));
218218}
219219
220test "math.atan32" {
220test "atan32" {
221221 const epsilon = 0.000001;
222222
223223 try expect(math.approxEqAbs(f32, atan32(0.2), 0.197396, epsilon));
......@@ -227,7 +227,7 @@ test "math.atan32" {
227227 try expect(math.approxEqAbs(f32, atan32(1.5), 0.982794, epsilon));
228228}
229229
230test "math.atan64" {
230test "atan64" {
231231 const epsilon = 0.000001;
232232
233233 try expect(math.approxEqAbs(f64, atan64(0.2), 0.197396, epsilon));
......@@ -237,7 +237,7 @@ test "math.atan64" {
237237 try expect(math.approxEqAbs(f64, atan64(1.5), 0.982794, epsilon));
238238}
239239
240test "math.atan32.special" {
240test "atan32.special" {
241241 const epsilon = 0.000001;
242242
243243 try expect(math.isPositiveZero(atan32(0.0)));
......@@ -246,7 +246,7 @@ test "math.atan32.special" {
246246 try expect(math.approxEqAbs(f32, atan32(-math.inf(f32)), -math.pi / 2.0, epsilon));
247247}
248248
249test "math.atan64.special" {
249test "atan64.special" {
250250 const epsilon = 0.000001;
251251
252252 try expect(math.isPositiveZero(atan64(0.0)));
lib/std/math/atan2.zig+5-5
......@@ -214,7 +214,7 @@ fn atan2_64(y: f64, x: f64) f64 {
214214 }
215215}
216216
217test "math.atan2" {
217test "atan2" {
218218 const y32: f32 = 0.2;
219219 const x32: f32 = 0.21;
220220 const y64: f64 = 0.2;
......@@ -223,7 +223,7 @@ test "math.atan2" {
223223 try expect(atan2(y64, x64) == atan2_64(0.2, 0.21));
224224}
225225
226test "math.atan2_32" {
226test "atan2_32" {
227227 const epsilon = 0.000001;
228228
229229 try expect(math.approxEqAbs(f32, atan2_32(0.0, 0.0), 0.0, epsilon));
......@@ -235,7 +235,7 @@ test "math.atan2_32" {
235235 try expect(math.approxEqAbs(f32, atan2_32(0.34, 1.243), 0.267001, epsilon));
236236}
237237
238test "math.atan2_64" {
238test "atan2_64" {
239239 const epsilon = 0.000001;
240240
241241 try expect(math.approxEqAbs(f64, atan2_64(0.0, 0.0), 0.0, epsilon));
......@@ -247,7 +247,7 @@ test "math.atan2_64" {
247247 try expect(math.approxEqAbs(f64, atan2_64(0.34, 1.243), 0.267001, epsilon));
248248}
249249
250test "math.atan2_32.special" {
250test "atan2_32.special" {
251251 const epsilon = 0.000001;
252252
253253 try expect(math.isNan(atan2_32(1.0, math.nan(f32))));
......@@ -271,7 +271,7 @@ test "math.atan2_32.special" {
271271 try expect(math.approxEqAbs(f32, atan2_32(-math.inf(f32), 1.0), -math.pi / 2.0, epsilon));
272272}
273273
274test "math.atan2_64.special" {
274test "atan2_64.special" {
275275 const epsilon = 0.000001;
276276
277277 try expect(math.isNan(atan2_64(1.0, math.nan(f64))));
lib/std/math/atanh.zig+5-5
......@@ -84,12 +84,12 @@ fn atanh_64(x: f64) f64 {
8484 return if (s != 0) -y else y;
8585}
8686
87test "math.atanh" {
87test "atanh" {
8888 try expect(atanh(@as(f32, 0.0)) == atanh_32(0.0));
8989 try expect(atanh(@as(f64, 0.0)) == atanh_64(0.0));
9090}
9191
92test "math.atanh_32" {
92test "atanh_32" {
9393 const epsilon = 0.000001;
9494
9595 try expect(math.approxEqAbs(f32, atanh_32(0.0), 0.0, epsilon));
......@@ -97,7 +97,7 @@ test "math.atanh_32" {
9797 try expect(math.approxEqAbs(f32, atanh_32(0.8923), 1.433099, epsilon));
9898}
9999
100test "math.atanh_64" {
100test "atanh_64" {
101101 const epsilon = 0.000001;
102102
103103 try expect(math.approxEqAbs(f64, atanh_64(0.0), 0.0, epsilon));
......@@ -105,7 +105,7 @@ test "math.atanh_64" {
105105 try expect(math.approxEqAbs(f64, atanh_64(0.8923), 1.433099, epsilon));
106106}
107107
108test "math.atanh32.special" {
108test "atanh32.special" {
109109 try expect(math.isPositiveInf(atanh_32(1)));
110110 try expect(math.isNegativeInf(atanh_32(-1)));
111111 try expect(math.isNan(atanh_32(1.5)));
......@@ -113,7 +113,7 @@ test "math.atanh32.special" {
113113 try expect(math.isNan(atanh_32(math.nan(f32))));
114114}
115115
116test "math.atanh64.special" {
116test "atanh64.special" {
117117 try expect(math.isPositiveInf(atanh_64(1)));
118118 try expect(math.isNegativeInf(atanh_64(-1)));
119119 try expect(math.isNan(atanh_64(1.5)));
lib/std/math/big/int_test.zig+195-195
......@@ -17,7 +17,7 @@ const minInt = std.math.minInt;
1717// They will still run on larger than this and should pass, but the multi-limb code-paths
1818// may be untested in some cases.
1919
20test "big.int comptime_int set" {
20test "comptime_int set" {
2121 comptime var s = 0xefffffff00000001eeeeeeefaaaaaaab;
2222 var a = try Managed.initSet(testing.allocator, s);
2323 defer a.deinit();
......@@ -33,7 +33,7 @@ test "big.int comptime_int set" {
3333 }
3434}
3535
36test "big.int comptime_int set negative" {
36test "comptime_int set negative" {
3737 var a = try Managed.initSet(testing.allocator, -10);
3838 defer a.deinit();
3939
......@@ -41,7 +41,7 @@ test "big.int comptime_int set negative" {
4141 try testing.expect(a.isPositive() == false);
4242}
4343
44test "big.int int set unaligned small" {
44test "int set unaligned small" {
4545 var a = try Managed.initSet(testing.allocator, @as(u7, 45));
4646 defer a.deinit();
4747
......@@ -49,28 +49,28 @@ test "big.int int set unaligned small" {
4949 try testing.expect(a.isPositive() == true);
5050}
5151
52test "big.int comptime_int to" {
52test "comptime_int to" {
5353 var a = try Managed.initSet(testing.allocator, 0xefffffff00000001eeeeeeefaaaaaaab);
5454 defer a.deinit();
5555
5656 try testing.expect((try a.to(u128)) == 0xefffffff00000001eeeeeeefaaaaaaab);
5757}
5858
59test "big.int sub-limb to" {
59test "sub-limb to" {
6060 var a = try Managed.initSet(testing.allocator, 10);
6161 defer a.deinit();
6262
6363 try testing.expect((try a.to(u8)) == 10);
6464}
6565
66test "big.int set negative minimum" {
66test "set negative minimum" {
6767 var a = try Managed.initSet(testing.allocator, @as(i64, minInt(i64)));
6868 defer a.deinit();
6969
7070 try testing.expect((try a.to(i64)) == minInt(i64));
7171}
7272
73test "big.int set double-width maximum then zero" {
73test "set double-width maximum then zero" {
7474 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
7575 defer a.deinit();
7676 try a.set(@as(DoubleLimb, 0));
......@@ -78,14 +78,14 @@ test "big.int set double-width maximum then zero" {
7878 try testing.expectEqual(@as(DoubleLimb, 0), try a.to(DoubleLimb));
7979}
8080
81test "big.int to target too small error" {
81test "to target too small error" {
8282 var a = try Managed.initSet(testing.allocator, 0xffffffff);
8383 defer a.deinit();
8484
8585 try testing.expectError(error.TargetTooSmall, a.to(u8));
8686}
8787
88test "big.int normalize" {
88test "normalize" {
8989 var a = try Managed.init(testing.allocator);
9090 defer a.deinit();
9191 try a.ensureCapacity(8);
......@@ -113,7 +113,7 @@ test "big.int normalize" {
113113 try testing.expect(a.len() == 1);
114114}
115115
116test "big.int normalize multi" {
116test "normalize multi" {
117117 var a = try Managed.init(testing.allocator);
118118 defer a.deinit();
119119 try a.ensureCapacity(8);
......@@ -143,7 +143,7 @@ test "big.int normalize multi" {
143143 try testing.expect(a.len() == 1);
144144}
145145
146test "big.int parity" {
146test "parity" {
147147 var a = try Managed.init(testing.allocator);
148148 defer a.deinit();
149149
......@@ -156,7 +156,7 @@ test "big.int parity" {
156156 try testing.expect(a.isOdd());
157157}
158158
159test "big.int bitcount + sizeInBaseUpperBound" {
159test "bitcount + sizeInBaseUpperBound" {
160160 var a = try Managed.init(testing.allocator);
161161 defer a.deinit();
162162
......@@ -184,7 +184,7 @@ test "big.int bitcount + sizeInBaseUpperBound" {
184184 try testing.expect(a.sizeInBaseUpperBound(2) >= 5033);
185185}
186186
187test "big.int bitcount/to" {
187test "bitcount/to" {
188188 var a = try Managed.init(testing.allocator);
189189 defer a.deinit();
190190
......@@ -215,7 +215,7 @@ test "big.int bitcount/to" {
215215 try testing.expect((try a.to(i9)) == -129);
216216}
217217
218test "big.int fits" {
218test "fits" {
219219 var a = try Managed.init(testing.allocator);
220220 defer a.deinit();
221221
......@@ -243,7 +243,7 @@ test "big.int fits" {
243243 try testing.expect(a.fits(u65));
244244}
245245
246test "big.int string set" {
246test "string set" {
247247 var a = try Managed.init(testing.allocator);
248248 defer a.deinit();
249249
......@@ -251,7 +251,7 @@ test "big.int string set" {
251251 try testing.expect((try a.to(u128)) == 120317241209124781241290847124);
252252}
253253
254test "big.int string negative" {
254test "string negative" {
255255 var a = try Managed.init(testing.allocator);
256256 defer a.deinit();
257257
......@@ -259,7 +259,7 @@ test "big.int string negative" {
259259 try testing.expect((try a.to(i32)) == -1023);
260260}
261261
262test "big.int string set number with underscores" {
262test "string set number with underscores" {
263263 var a = try Managed.init(testing.allocator);
264264 defer a.deinit();
265265
......@@ -267,7 +267,7 @@ test "big.int string set number with underscores" {
267267 try testing.expect((try a.to(u128)) == 120317241209124781241290847124);
268268}
269269
270test "big.int string set case insensitive number" {
270test "string set case insensitive number" {
271271 var a = try Managed.init(testing.allocator);
272272 defer a.deinit();
273273
......@@ -275,19 +275,19 @@ test "big.int string set case insensitive number" {
275275 try testing.expect((try a.to(u32)) == 0xabcdef);
276276}
277277
278test "big.int string set bad char error" {
278test "string set bad char error" {
279279 var a = try Managed.init(testing.allocator);
280280 defer a.deinit();
281281 try testing.expectError(error.InvalidCharacter, a.setString(10, "x"));
282282}
283283
284test "big.int string set bad base error" {
284test "string set bad base error" {
285285 var a = try Managed.init(testing.allocator);
286286 defer a.deinit();
287287 try testing.expectError(error.InvalidBase, a.setString(45, "10"));
288288}
289289
290test "big.int twos complement limit set" {
290test "twos complement limit set" {
291291 const test_types = [_]type{
292292 u64,
293293 i64,
......@@ -315,7 +315,7 @@ test "big.int twos complement limit set" {
315315 }
316316}
317317
318test "big.int string to" {
318test "string to" {
319319 var a = try Managed.initSet(testing.allocator, 120317241209124781241290847124);
320320 defer a.deinit();
321321
......@@ -326,14 +326,14 @@ test "big.int string to" {
326326 try testing.expect(mem.eql(u8, as, es));
327327}
328328
329test "big.int string to base base error" {
329test "string to base base error" {
330330 var a = try Managed.initSet(testing.allocator, 0xffffffff);
331331 defer a.deinit();
332332
333333 try testing.expectError(error.InvalidBase, a.toString(testing.allocator, 45, .lower));
334334}
335335
336test "big.int string to base 2" {
336test "string to base 2" {
337337 var a = try Managed.initSet(testing.allocator, -0b1011);
338338 defer a.deinit();
339339
......@@ -344,7 +344,7 @@ test "big.int string to base 2" {
344344 try testing.expect(mem.eql(u8, as, es));
345345}
346346
347test "big.int string to base 16" {
347test "string to base 16" {
348348 var a = try Managed.initSet(testing.allocator, 0xefffffff00000001eeeeeeefaaaaaaab);
349349 defer a.deinit();
350350
......@@ -355,7 +355,7 @@ test "big.int string to base 16" {
355355 try testing.expect(mem.eql(u8, as, es));
356356}
357357
358test "big.int neg string to" {
358test "neg string to" {
359359 var a = try Managed.initSet(testing.allocator, -123907434);
360360 defer a.deinit();
361361
......@@ -366,7 +366,7 @@ test "big.int neg string to" {
366366 try testing.expect(mem.eql(u8, as, es));
367367}
368368
369test "big.int zero string to" {
369test "zero string to" {
370370 var a = try Managed.initSet(testing.allocator, 0);
371371 defer a.deinit();
372372
......@@ -377,7 +377,7 @@ test "big.int zero string to" {
377377 try testing.expect(mem.eql(u8, as, es));
378378}
379379
380test "big.int clone" {
380test "clone" {
381381 var a = try Managed.initSet(testing.allocator, 1234);
382382 defer a.deinit();
383383 var b = try a.clone();
......@@ -391,7 +391,7 @@ test "big.int clone" {
391391 try testing.expect((try b.to(u32)) == 1234);
392392}
393393
394test "big.int swap" {
394test "swap" {
395395 var a = try Managed.initSet(testing.allocator, 1234);
396396 defer a.deinit();
397397 var b = try Managed.initSet(testing.allocator, 5678);
......@@ -406,14 +406,14 @@ test "big.int swap" {
406406 try testing.expect((try b.to(u32)) == 1234);
407407}
408408
409test "big.int to negative" {
409test "to negative" {
410410 var a = try Managed.initSet(testing.allocator, -10);
411411 defer a.deinit();
412412
413413 try testing.expect((try a.to(i32)) == -10);
414414}
415415
416test "big.int compare" {
416test "compare" {
417417 var a = try Managed.initSet(testing.allocator, -11);
418418 defer a.deinit();
419419 var b = try Managed.initSet(testing.allocator, 10);
......@@ -423,7 +423,7 @@ test "big.int compare" {
423423 try testing.expect(a.order(b) == .lt);
424424}
425425
426test "big.int compare similar" {
426test "compare similar" {
427427 var a = try Managed.initSet(testing.allocator, 0xffffffffeeeeeeeeffffffffeeeeeeee);
428428 defer a.deinit();
429429 var b = try Managed.initSet(testing.allocator, 0xffffffffeeeeeeeeffffffffeeeeeeef);
......@@ -433,7 +433,7 @@ test "big.int compare similar" {
433433 try testing.expect(b.orderAbs(a) == .gt);
434434}
435435
436test "big.int compare different limb size" {
436test "compare different limb size" {
437437 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
438438 defer a.deinit();
439439 var b = try Managed.initSet(testing.allocator, 1);
......@@ -443,7 +443,7 @@ test "big.int compare different limb size" {
443443 try testing.expect(b.orderAbs(a) == .lt);
444444}
445445
446test "big.int compare multi-limb" {
446test "compare multi-limb" {
447447 var a = try Managed.initSet(testing.allocator, -0x7777777799999999ffffeeeeffffeeeeffffeeeef);
448448 defer a.deinit();
449449 var b = try Managed.initSet(testing.allocator, 0x7777777799999999ffffeeeeffffeeeeffffeeeee);
......@@ -453,7 +453,7 @@ test "big.int compare multi-limb" {
453453 try testing.expect(a.order(b) == .lt);
454454}
455455
456test "big.int equality" {
456test "equality" {
457457 var a = try Managed.initSet(testing.allocator, 0xffffffff1);
458458 defer a.deinit();
459459 var b = try Managed.initSet(testing.allocator, -0xffffffff1);
......@@ -463,7 +463,7 @@ test "big.int equality" {
463463 try testing.expect(!a.eql(b));
464464}
465465
466test "big.int abs" {
466test "abs" {
467467 var a = try Managed.initSet(testing.allocator, -5);
468468 defer a.deinit();
469469
......@@ -474,7 +474,7 @@ test "big.int abs" {
474474 try testing.expect((try a.to(u32)) == 5);
475475}
476476
477test "big.int negate" {
477test "negate" {
478478 var a = try Managed.initSet(testing.allocator, 5);
479479 defer a.deinit();
480480
......@@ -485,7 +485,7 @@ test "big.int negate" {
485485 try testing.expect((try a.to(i32)) == 5);
486486}
487487
488test "big.int add single-single" {
488test "add single-single" {
489489 var a = try Managed.initSet(testing.allocator, 50);
490490 defer a.deinit();
491491 var b = try Managed.initSet(testing.allocator, 5);
......@@ -498,7 +498,7 @@ test "big.int add single-single" {
498498 try testing.expect((try c.to(u32)) == 55);
499499}
500500
501test "big.int add multi-single" {
501test "add multi-single" {
502502 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
503503 defer a.deinit();
504504 var b = try Managed.initSet(testing.allocator, 1);
......@@ -514,7 +514,7 @@ test "big.int add multi-single" {
514514 try testing.expect((try c.to(DoubleLimb)) == maxInt(Limb) + 2);
515515}
516516
517test "big.int add multi-multi" {
517test "add multi-multi" {
518518 var op1: u128 = 0xefefefef7f7f7f7f;
519519 var op2: u128 = 0xfefefefe9f9f9f9f;
520520 // These must be runtime-known to prevent this comparison being tautological, as the
......@@ -532,7 +532,7 @@ test "big.int add multi-multi" {
532532 try testing.expect((try c.to(u128)) == op1 + op2);
533533}
534534
535test "big.int add zero-zero" {
535test "add zero-zero" {
536536 var a = try Managed.initSet(testing.allocator, 0);
537537 defer a.deinit();
538538 var b = try Managed.initSet(testing.allocator, 0);
......@@ -545,7 +545,7 @@ test "big.int add zero-zero" {
545545 try testing.expect((try c.to(u32)) == 0);
546546}
547547
548test "big.int add alias multi-limb nonzero-zero" {
548test "add alias multi-limb nonzero-zero" {
549549 const op1 = 0xffffffff777777771;
550550 var a = try Managed.initSet(testing.allocator, op1);
551551 defer a.deinit();
......@@ -557,7 +557,7 @@ test "big.int add alias multi-limb nonzero-zero" {
557557 try testing.expect((try a.to(u128)) == op1);
558558}
559559
560test "big.int add sign" {
560test "add sign" {
561561 var a = try Managed.init(testing.allocator);
562562 defer a.deinit();
563563
......@@ -583,7 +583,7 @@ test "big.int add sign" {
583583 try testing.expect((try a.to(i32)) == -3);
584584}
585585
586test "big.int add comptime scalar" {
586test "add comptime scalar" {
587587 var a = try Managed.initSet(testing.allocator, 50);
588588 defer a.deinit();
589589
......@@ -594,7 +594,7 @@ test "big.int add comptime scalar" {
594594 try testing.expect((try b.to(u32)) == 55);
595595}
596596
597test "big.int add scalar" {
597test "add scalar" {
598598 var a = try Managed.initSet(testing.allocator, 123);
599599 defer a.deinit();
600600
......@@ -605,7 +605,7 @@ test "big.int add scalar" {
605605 try testing.expect((try b.to(u32)) == 154);
606606}
607607
608test "big.int addWrap single-single, unsigned" {
608test "addWrap single-single, unsigned" {
609609 var a = try Managed.initSet(testing.allocator, maxInt(u17));
610610 defer a.deinit();
611611
......@@ -618,7 +618,7 @@ test "big.int addWrap single-single, unsigned" {
618618 try testing.expect((try a.to(u17)) == 9);
619619}
620620
621test "big.int subWrap single-single, unsigned" {
621test "subWrap single-single, unsigned" {
622622 var a = try Managed.initSet(testing.allocator, 0);
623623 defer a.deinit();
624624
......@@ -631,7 +631,7 @@ test "big.int subWrap single-single, unsigned" {
631631 try testing.expect((try a.to(u17)) == 1);
632632}
633633
634test "big.int addWrap multi-multi, unsigned, limb aligned" {
634test "addWrap multi-multi, unsigned, limb aligned" {
635635 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
636636 defer a.deinit();
637637
......@@ -644,7 +644,7 @@ test "big.int addWrap multi-multi, unsigned, limb aligned" {
644644 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb) - 1);
645645}
646646
647test "big.int subWrap single-multi, unsigned, limb aligned" {
647test "subWrap single-multi, unsigned, limb aligned" {
648648 var a = try Managed.initSet(testing.allocator, 10);
649649 defer a.deinit();
650650
......@@ -657,7 +657,7 @@ test "big.int subWrap single-multi, unsigned, limb aligned" {
657657 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb) - 88);
658658}
659659
660test "big.int addWrap single-single, signed" {
660test "addWrap single-single, signed" {
661661 var a = try Managed.initSet(testing.allocator, maxInt(i21));
662662 defer a.deinit();
663663
......@@ -670,7 +670,7 @@ test "big.int addWrap single-single, signed" {
670670 try testing.expect((try a.to(i21)) == minInt(i21));
671671}
672672
673test "big.int subWrap single-single, signed" {
673test "subWrap single-single, signed" {
674674 var a = try Managed.initSet(testing.allocator, minInt(i21));
675675 defer a.deinit();
676676
......@@ -683,7 +683,7 @@ test "big.int subWrap single-single, signed" {
683683 try testing.expect((try a.to(i21)) == maxInt(i21));
684684}
685685
686test "big.int addWrap multi-multi, signed, limb aligned" {
686test "addWrap multi-multi, signed, limb aligned" {
687687 var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb));
688688 defer a.deinit();
689689
......@@ -696,7 +696,7 @@ test "big.int addWrap multi-multi, signed, limb aligned" {
696696 try testing.expect((try a.to(SignedDoubleLimb)) == -2);
697697}
698698
699test "big.int subWrap single-multi, signed, limb aligned" {
699test "subWrap single-multi, signed, limb aligned" {
700700 var a = try Managed.initSet(testing.allocator, minInt(SignedDoubleLimb));
701701 defer a.deinit();
702702
......@@ -709,7 +709,7 @@ test "big.int subWrap single-multi, signed, limb aligned" {
709709 try testing.expect((try a.to(SignedDoubleLimb)) == maxInt(SignedDoubleLimb));
710710}
711711
712test "big.int addSat single-single, unsigned" {
712test "addSat single-single, unsigned" {
713713 var a = try Managed.initSet(testing.allocator, maxInt(u17) - 5);
714714 defer a.deinit();
715715
......@@ -721,7 +721,7 @@ test "big.int addSat single-single, unsigned" {
721721 try testing.expect((try a.to(u17)) == maxInt(u17));
722722}
723723
724test "big.int subSat single-single, unsigned" {
724test "subSat single-single, unsigned" {
725725 var a = try Managed.initSet(testing.allocator, 123);
726726 defer a.deinit();
727727
......@@ -733,7 +733,7 @@ test "big.int subSat single-single, unsigned" {
733733 try testing.expect((try a.to(u17)) == 0);
734734}
735735
736test "big.int addSat multi-multi, unsigned, limb aligned" {
736test "addSat multi-multi, unsigned, limb aligned" {
737737 var a = try Managed.initSet(testing.allocator, maxInt(DoubleLimb));
738738 defer a.deinit();
739739
......@@ -745,7 +745,7 @@ test "big.int addSat multi-multi, unsigned, limb aligned" {
745745 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb));
746746}
747747
748test "big.int subSat single-multi, unsigned, limb aligned" {
748test "subSat single-multi, unsigned, limb aligned" {
749749 var a = try Managed.initSet(testing.allocator, 10);
750750 defer a.deinit();
751751
......@@ -757,7 +757,7 @@ test "big.int subSat single-multi, unsigned, limb aligned" {
757757 try testing.expect((try a.to(DoubleLimb)) == 0);
758758}
759759
760test "big.int addSat single-single, signed" {
760test "addSat single-single, signed" {
761761 var a = try Managed.initSet(testing.allocator, maxInt(i14));
762762 defer a.deinit();
763763
......@@ -769,7 +769,7 @@ test "big.int addSat single-single, signed" {
769769 try testing.expect((try a.to(i14)) == maxInt(i14));
770770}
771771
772test "big.int subSat single-single, signed" {
772test "subSat single-single, signed" {
773773 var a = try Managed.initSet(testing.allocator, minInt(i21));
774774 defer a.deinit();
775775
......@@ -781,7 +781,7 @@ test "big.int subSat single-single, signed" {
781781 try testing.expect((try a.to(i21)) == minInt(i21));
782782}
783783
784test "big.int addSat multi-multi, signed, limb aligned" {
784test "addSat multi-multi, signed, limb aligned" {
785785 var a = try Managed.initSet(testing.allocator, maxInt(SignedDoubleLimb));
786786 defer a.deinit();
787787
......@@ -793,7 +793,7 @@ test "big.int addSat multi-multi, signed, limb aligned" {
793793 try testing.expect((try a.to(SignedDoubleLimb)) == maxInt(SignedDoubleLimb));
794794}
795795
796test "big.int subSat single-multi, signed, limb aligned" {
796test "subSat single-multi, signed, limb aligned" {
797797 var a = try Managed.initSet(testing.allocator, minInt(SignedDoubleLimb));
798798 defer a.deinit();
799799
......@@ -805,7 +805,7 @@ test "big.int subSat single-multi, signed, limb aligned" {
805805 try testing.expect((try a.to(SignedDoubleLimb)) == minInt(SignedDoubleLimb));
806806}
807807
808test "big.int sub single-single" {
808test "sub single-single" {
809809 var a = try Managed.initSet(testing.allocator, 50);
810810 defer a.deinit();
811811 var b = try Managed.initSet(testing.allocator, 5);
......@@ -818,7 +818,7 @@ test "big.int sub single-single" {
818818 try testing.expect((try c.to(u32)) == 45);
819819}
820820
821test "big.int sub multi-single" {
821test "sub multi-single" {
822822 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
823823 defer a.deinit();
824824 var b = try Managed.initSet(testing.allocator, 1);
......@@ -831,7 +831,7 @@ test "big.int sub multi-single" {
831831 try testing.expect((try c.to(Limb)) == maxInt(Limb));
832832}
833833
834test "big.int sub multi-multi" {
834test "sub multi-multi" {
835835 var op1: u128 = 0xefefefefefefefefefefefef;
836836 var op2: u128 = 0xabababababababababababab;
837837 _ = .{ &op1, &op2 };
......@@ -848,7 +848,7 @@ test "big.int sub multi-multi" {
848848 try testing.expect((try c.to(u128)) == op1 - op2);
849849}
850850
851test "big.int sub equal" {
851test "sub equal" {
852852 var a = try Managed.initSet(testing.allocator, 0x11efefefefefefefefefefefef);
853853 defer a.deinit();
854854 var b = try Managed.initSet(testing.allocator, 0x11efefefefefefefefefefefef);
......@@ -861,7 +861,7 @@ test "big.int sub equal" {
861861 try testing.expect((try c.to(u32)) == 0);
862862}
863863
864test "big.int sub sign" {
864test "sub sign" {
865865 var a = try Managed.init(testing.allocator);
866866 defer a.deinit();
867867
......@@ -890,7 +890,7 @@ test "big.int sub sign" {
890890 try testing.expect((try a.to(i32)) == -1);
891891}
892892
893test "big.int mul single-single" {
893test "mul single-single" {
894894 var a = try Managed.initSet(testing.allocator, 50);
895895 defer a.deinit();
896896 var b = try Managed.initSet(testing.allocator, 5);
......@@ -903,7 +903,7 @@ test "big.int mul single-single" {
903903 try testing.expect((try c.to(u64)) == 250);
904904}
905905
906test "big.int mul multi-single" {
906test "mul multi-single" {
907907 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
908908 defer a.deinit();
909909 var b = try Managed.initSet(testing.allocator, 2);
......@@ -916,7 +916,7 @@ test "big.int mul multi-single" {
916916 try testing.expect((try c.to(DoubleLimb)) == 2 * maxInt(Limb));
917917}
918918
919test "big.int mul multi-multi" {
919test "mul multi-multi" {
920920 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
921921
922922 var op1: u256 = 0x998888efefefefefefefef;
......@@ -935,7 +935,7 @@ test "big.int mul multi-multi" {
935935 try testing.expect((try c.to(u256)) == op1 * op2);
936936}
937937
938test "big.int mul alias r with a" {
938test "mul alias r with a" {
939939 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
940940 defer a.deinit();
941941 var b = try Managed.initSet(testing.allocator, 2);
......@@ -946,7 +946,7 @@ test "big.int mul alias r with a" {
946946 try testing.expect((try a.to(DoubleLimb)) == 2 * maxInt(Limb));
947947}
948948
949test "big.int mul alias r with b" {
949test "mul alias r with b" {
950950 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
951951 defer a.deinit();
952952 var b = try Managed.initSet(testing.allocator, 2);
......@@ -957,7 +957,7 @@ test "big.int mul alias r with b" {
957957 try testing.expect((try a.to(DoubleLimb)) == 2 * maxInt(Limb));
958958}
959959
960test "big.int mul alias r with a and b" {
960test "mul alias r with a and b" {
961961 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
962962 defer a.deinit();
963963
......@@ -966,7 +966,7 @@ test "big.int mul alias r with a and b" {
966966 try testing.expect((try a.to(DoubleLimb)) == maxInt(Limb) * maxInt(Limb));
967967}
968968
969test "big.int mul a*0" {
969test "mul a*0" {
970970 var a = try Managed.initSet(testing.allocator, 0xefefefefefefefef);
971971 defer a.deinit();
972972 var b = try Managed.initSet(testing.allocator, 0);
......@@ -979,7 +979,7 @@ test "big.int mul a*0" {
979979 try testing.expect((try c.to(u32)) == 0);
980980}
981981
982test "big.int mul 0*0" {
982test "mul 0*0" {
983983 var a = try Managed.initSet(testing.allocator, 0);
984984 defer a.deinit();
985985 var b = try Managed.initSet(testing.allocator, 0);
......@@ -992,7 +992,7 @@ test "big.int mul 0*0" {
992992 try testing.expect((try c.to(u32)) == 0);
993993}
994994
995test "big.int mul large" {
995test "mul large" {
996996 var a = try Managed.initCapacity(testing.allocator, 50);
997997 defer a.deinit();
998998 var b = try Managed.initCapacity(testing.allocator, 100);
......@@ -1013,7 +1013,7 @@ test "big.int mul large" {
10131013 try testing.expect(b.eql(c));
10141014}
10151015
1016test "big.int mulWrap single-single unsigned" {
1016test "mulWrap single-single unsigned" {
10171017 var a = try Managed.initSet(testing.allocator, 1234);
10181018 defer a.deinit();
10191019 var b = try Managed.initSet(testing.allocator, 5678);
......@@ -1026,7 +1026,7 @@ test "big.int mulWrap single-single unsigned" {
10261026 try testing.expect((try c.to(u17)) == 59836);
10271027}
10281028
1029test "big.int mulWrap single-single signed" {
1029test "mulWrap single-single signed" {
10301030 var a = try Managed.initSet(testing.allocator, 1234);
10311031 defer a.deinit();
10321032 var b = try Managed.initSet(testing.allocator, -5678);
......@@ -1039,7 +1039,7 @@ test "big.int mulWrap single-single signed" {
10391039 try testing.expect((try c.to(i17)) == -59836);
10401040}
10411041
1042test "big.int mulWrap multi-multi unsigned" {
1042test "mulWrap multi-multi unsigned" {
10431043 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
10441044
10451045 var op1: u256 = 0x998888efefefefefefefef;
......@@ -1058,7 +1058,7 @@ test "big.int mulWrap multi-multi unsigned" {
10581058 try testing.expect((try c.to(u256)) == (op1 * op2) & ((1 << 65) - 1));
10591059}
10601060
1061test "big.int mulWrap multi-multi signed" {
1061test "mulWrap multi-multi signed" {
10621062 switch (builtin.zig_backend) {
10631063 .stage2_c => return error.SkipZigTest,
10641064 else => {},
......@@ -1076,7 +1076,7 @@ test "big.int mulWrap multi-multi signed" {
10761076 try testing.expect((try c.to(SignedDoubleLimb)) == minInt(SignedDoubleLimb) + 2);
10771077}
10781078
1079test "big.int mulWrap large" {
1079test "mulWrap large" {
10801080 var a = try Managed.initCapacity(testing.allocator, 50);
10811081 defer a.deinit();
10821082 var b = try Managed.initCapacity(testing.allocator, 100);
......@@ -1100,7 +1100,7 @@ test "big.int mulWrap large" {
11001100 try testing.expect(b.eql(c));
11011101}
11021102
1103test "big.int div single-half no rem" {
1103test "div single-half no rem" {
11041104 var a = try Managed.initSet(testing.allocator, 50);
11051105 defer a.deinit();
11061106 var b = try Managed.initSet(testing.allocator, 5);
......@@ -1116,7 +1116,7 @@ test "big.int div single-half no rem" {
11161116 try testing.expect((try r.to(u32)) == 0);
11171117}
11181118
1119test "big.int div single-half with rem" {
1119test "div single-half with rem" {
11201120 var a = try Managed.initSet(testing.allocator, 49);
11211121 defer a.deinit();
11221122 var b = try Managed.initSet(testing.allocator, 5);
......@@ -1132,7 +1132,7 @@ test "big.int div single-half with rem" {
11321132 try testing.expect((try r.to(u32)) == 4);
11331133}
11341134
1135test "big.int div single-single no rem" {
1135test "div single-single no rem" {
11361136 // assumes usize is <= 64 bits.
11371137 var a = try Managed.initSet(testing.allocator, 1 << 52);
11381138 defer a.deinit();
......@@ -1149,7 +1149,7 @@ test "big.int div single-single no rem" {
11491149 try testing.expect((try r.to(u32)) == 0);
11501150}
11511151
1152test "big.int div single-single with rem" {
1152test "div single-single with rem" {
11531153 var a = try Managed.initSet(testing.allocator, (1 << 52) | (1 << 33));
11541154 defer a.deinit();
11551155 var b = try Managed.initSet(testing.allocator, (1 << 35));
......@@ -1165,7 +1165,7 @@ test "big.int div single-single with rem" {
11651165 try testing.expect((try r.to(u64)) == 8589934592);
11661166}
11671167
1168test "big.int div multi-single no rem" {
1168test "div multi-single no rem" {
11691169 var op1: u128 = 0xffffeeeeddddcccc;
11701170 var op2: u128 = 34;
11711171 _ = .{ &op1, &op2 };
......@@ -1185,7 +1185,7 @@ test "big.int div multi-single no rem" {
11851185 try testing.expect((try r.to(u64)) == 0);
11861186}
11871187
1188test "big.int div multi-single with rem" {
1188test "div multi-single with rem" {
11891189 var op1: u128 = 0xffffeeeeddddcccf;
11901190 var op2: u128 = 34;
11911191 _ = .{ &op1, &op2 };
......@@ -1205,7 +1205,7 @@ test "big.int div multi-single with rem" {
12051205 try testing.expect((try r.to(u64)) == 3);
12061206}
12071207
1208test "big.int div multi>2-single" {
1208test "div multi>2-single" {
12091209 var op1: u128 = 0xfefefefefefefefefefefefefefefefe;
12101210 var op2: u128 = 0xefab8;
12111211 _ = .{ &op1, &op2 };
......@@ -1225,7 +1225,7 @@ test "big.int div multi>2-single" {
12251225 try testing.expect((try r.to(u32)) == 0x3e4e);
12261226}
12271227
1228test "big.int div single-single q < r" {
1228test "div single-single q < r" {
12291229 var a = try Managed.initSet(testing.allocator, 0x0078f432);
12301230 defer a.deinit();
12311231 var b = try Managed.initSet(testing.allocator, 0x01000000);
......@@ -1241,7 +1241,7 @@ test "big.int div single-single q < r" {
12411241 try testing.expect((try r.to(u64)) == 0x0078f432);
12421242}
12431243
1244test "big.int div single-single q == r" {
1244test "div single-single q == r" {
12451245 var a = try Managed.initSet(testing.allocator, 10);
12461246 defer a.deinit();
12471247 var b = try Managed.initSet(testing.allocator, 10);
......@@ -1257,7 +1257,7 @@ test "big.int div single-single q == r" {
12571257 try testing.expect((try r.to(u64)) == 0);
12581258}
12591259
1260test "big.int div q=0 alias" {
1260test "div q=0 alias" {
12611261 var a = try Managed.initSet(testing.allocator, 3);
12621262 defer a.deinit();
12631263 var b = try Managed.initSet(testing.allocator, 10);
......@@ -1269,7 +1269,7 @@ test "big.int div q=0 alias" {
12691269 try testing.expect((try b.to(u64)) == 3);
12701270}
12711271
1272test "big.int div multi-multi q < r" {
1272test "div multi-multi q < r" {
12731273 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
12741274
12751275 const op1 = 0x1ffffffff0078f432;
......@@ -1289,7 +1289,7 @@ test "big.int div multi-multi q < r" {
12891289 try testing.expect((try r.to(u128)) == op1);
12901290}
12911291
1292test "big.int div trunc single-single +/+" {
1292test "div trunc single-single +/+" {
12931293 const u: i32 = 5;
12941294 const v: i32 = 3;
12951295
......@@ -1313,7 +1313,7 @@ test "big.int div trunc single-single +/+" {
13131313 try testing.expect((try r.to(i32)) == er);
13141314}
13151315
1316test "big.int div trunc single-single -/+" {
1316test "div trunc single-single -/+" {
13171317 const u: i32 = -5;
13181318 const v: i32 = 3;
13191319
......@@ -1337,7 +1337,7 @@ test "big.int div trunc single-single -/+" {
13371337 try testing.expect((try r.to(i32)) == er);
13381338}
13391339
1340test "big.int div trunc single-single +/-" {
1340test "div trunc single-single +/-" {
13411341 const u: i32 = 5;
13421342 const v: i32 = -3;
13431343
......@@ -1361,7 +1361,7 @@ test "big.int div trunc single-single +/-" {
13611361 try testing.expect((try r.to(i32)) == er);
13621362}
13631363
1364test "big.int div trunc single-single -/-" {
1364test "div trunc single-single -/-" {
13651365 const u: i32 = -5;
13661366 const v: i32 = -3;
13671367
......@@ -1385,7 +1385,7 @@ test "big.int div trunc single-single -/-" {
13851385 try testing.expect((try r.to(i32)) == er);
13861386}
13871387
1388test "big.int divTrunc #15535" {
1388test "divTrunc #15535" {
13891389 var one = try Managed.initSet(testing.allocator, 1);
13901390 defer one.deinit();
13911391 var x = try Managed.initSet(testing.allocator, std.math.pow(u128, 2, 64));
......@@ -1398,7 +1398,7 @@ test "big.int divTrunc #15535" {
13981398 try testing.expect(r.order(one) == std.math.Order.lt);
13991399}
14001400
1401test "big.int divFloor #10932" {
1401test "divFloor #10932" {
14021402 var a = try Managed.init(testing.allocator);
14031403 defer a.deinit();
14041404
......@@ -1422,7 +1422,7 @@ test "big.int divFloor #10932" {
14221422 try testing.expect((try mod.to(i32)) == 0);
14231423}
14241424
1425test "big.int divFloor #11166" {
1425test "divFloor #11166" {
14261426 var a = try Managed.init(testing.allocator);
14271427 defer a.deinit();
14281428
......@@ -1449,7 +1449,7 @@ test "big.int divFloor #11166" {
14491449 try testing.expect(std.mem.eql(u8, mods, "870000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"));
14501450}
14511451
1452test "big.int gcd #10932" {
1452test "gcd #10932" {
14531453 var a = try Managed.init(testing.allocator);
14541454 defer a.deinit();
14551455
......@@ -1469,7 +1469,7 @@ test "big.int gcd #10932" {
14691469 try testing.expect(std.mem.eql(u8, ress, "1a974a5c9734476ff5a3604bcc678a756beacfc21b4427d1f2c1f56f5d4e411a162c56136e20000000000000000000000000000000"));
14701470}
14711471
1472test "big.int bitAnd #10932" {
1472test "bitAnd #10932" {
14731473 var a = try Managed.init(testing.allocator);
14741474 defer a.deinit();
14751475
......@@ -1487,7 +1487,7 @@ test "big.int bitAnd #10932" {
14871487 try testing.expect((try res.to(i32)) == 0);
14881488}
14891489
1490test "big.int div floor single-single +/+" {
1490test "div floor single-single +/+" {
14911491 const u: i32 = 5;
14921492 const v: i32 = 3;
14931493
......@@ -1511,7 +1511,7 @@ test "big.int div floor single-single +/+" {
15111511 try testing.expect((try r.to(i32)) == er);
15121512}
15131513
1514test "big.int div floor single-single -/+" {
1514test "div floor single-single -/+" {
15151515 const u: i32 = -5;
15161516 const v: i32 = 3;
15171517
......@@ -1535,7 +1535,7 @@ test "big.int div floor single-single -/+" {
15351535 try testing.expect((try r.to(i32)) == er);
15361536}
15371537
1538test "big.int div floor single-single +/-" {
1538test "div floor single-single +/-" {
15391539 const u: i32 = 5;
15401540 const v: i32 = -3;
15411541
......@@ -1559,7 +1559,7 @@ test "big.int div floor single-single +/-" {
15591559 try testing.expect((try r.to(i32)) == er);
15601560}
15611561
1562test "big.int div floor single-single -/-" {
1562test "div floor single-single -/-" {
15631563 const u: i32 = -5;
15641564 const v: i32 = -3;
15651565
......@@ -1583,7 +1583,7 @@ test "big.int div floor single-single -/-" {
15831583 try testing.expect((try r.to(i32)) == er);
15841584}
15851585
1586test "big.int div floor no remainder negative quotient" {
1586test "div floor no remainder negative quotient" {
15871587 const u: i32 = -0x80000000;
15881588 const v: i32 = 1;
15891589
......@@ -1602,7 +1602,7 @@ test "big.int div floor no remainder negative quotient" {
16021602 try testing.expect((try r.to(i32)) == 0);
16031603}
16041604
1605test "big.int div floor negative close to zero" {
1605test "div floor negative close to zero" {
16061606 const u: i32 = -2;
16071607 const v: i32 = 12;
16081608
......@@ -1621,7 +1621,7 @@ test "big.int div floor negative close to zero" {
16211621 try testing.expect((try r.to(i32)) == 10);
16221622}
16231623
1624test "big.int div floor positive close to zero" {
1624test "div floor positive close to zero" {
16251625 const u: i32 = 10;
16261626 const v: i32 = 12;
16271627
......@@ -1640,7 +1640,7 @@ test "big.int div floor positive close to zero" {
16401640 try testing.expect((try r.to(i32)) == 10);
16411641}
16421642
1643test "big.int div multi-multi with rem" {
1643test "div multi-multi with rem" {
16441644 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
16451645
16461646 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeeddddccccbbbbaaaa9999);
......@@ -1658,7 +1658,7 @@ test "big.int div multi-multi with rem" {
16581658 try testing.expect((try r.to(u128)) == 0x28de0acacd806823638);
16591659}
16601660
1661test "big.int div multi-multi no rem" {
1661test "div multi-multi no rem" {
16621662 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
16631663
16641664 var a = try Managed.initSet(testing.allocator, 0x8888999911110000ffffeeeedb4fec200ee3a4286361);
......@@ -1676,7 +1676,7 @@ test "big.int div multi-multi no rem" {
16761676 try testing.expect((try r.to(u128)) == 0);
16771677}
16781678
1679test "big.int div multi-multi (2 branch)" {
1679test "div multi-multi (2 branch)" {
16801680 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
16811681
16821682 var a = try Managed.initSet(testing.allocator, 0x866666665555555588888887777777761111111111111111);
......@@ -1694,7 +1694,7 @@ test "big.int div multi-multi (2 branch)" {
16941694 try testing.expect((try r.to(u128)) == 0x44444443444444431111111111111111);
16951695}
16961696
1697test "big.int div multi-multi (3.1/3.3 branch)" {
1697test "div multi-multi (3.1/3.3 branch)" {
16981698 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
16991699
17001700 var a = try Managed.initSet(testing.allocator, 0x11111111111111111111111111111111111111111111111111111111111111);
......@@ -1712,7 +1712,7 @@ test "big.int div multi-multi (3.1/3.3 branch)" {
17121712 try testing.expect((try r.to(u256)) == 0x1111111111111111111110b12222222222222222282);
17131713}
17141714
1715test "big.int div multi-single zero-limb trailing" {
1715test "div multi-single zero-limb trailing" {
17161716 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
17171717
17181718 var a = try Managed.initSet(testing.allocator, 0x60000000000000000000000000000000000000000000000000000000000000000);
......@@ -1732,7 +1732,7 @@ test "big.int div multi-single zero-limb trailing" {
17321732 try testing.expect(r.eqlZero());
17331733}
17341734
1735test "big.int div multi-multi zero-limb trailing (with rem)" {
1735test "div multi-multi zero-limb trailing (with rem)" {
17361736 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
17371737
17381738 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
......@@ -1753,7 +1753,7 @@ test "big.int div multi-multi zero-limb trailing (with rem)" {
17531753 try testing.expect(std.mem.eql(u8, rs, "4444444344444443111111111111111100000000000000000000000000000000"));
17541754}
17551755
1756test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count > divisor zero-limb count" {
1756test "div multi-multi zero-limb trailing (with rem) and dividend zero-limb count > divisor zero-limb count" {
17571757 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
17581758
17591759 var a = try Managed.initSet(testing.allocator, 0x8666666655555555888888877777777611111111111111110000000000000000);
......@@ -1774,7 +1774,7 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
17741774 try testing.expect(std.mem.eql(u8, rs, "444444434444444311111111111111110000000000000000"));
17751775}
17761776
1777test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-limb count < divisor zero-limb count" {
1777test "div multi-multi zero-limb trailing (with rem) and dividend zero-limb count < divisor zero-limb count" {
17781778 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
17791779
17801780 var a = try Managed.initSet(testing.allocator, 0x86666666555555558888888777777776111111111111111100000000000000000000000000000000);
......@@ -1797,7 +1797,7 @@ test "big.int div multi-multi zero-limb trailing (with rem) and dividend zero-li
17971797 try testing.expect(std.mem.eql(u8, rs, "4e11f2baa5896a321d463b543d0104e30000000000000000"));
17981798}
17991799
1800test "big.int div multi-multi fuzz case #1" {
1800test "div multi-multi fuzz case #1" {
18011801 var a = try Managed.init(testing.allocator);
18021802 defer a.deinit();
18031803 var b = try Managed.init(testing.allocator);
......@@ -1821,7 +1821,7 @@ test "big.int div multi-multi fuzz case #1" {
18211821 try testing.expect(std.mem.eql(u8, rs, "310d1d4c414426b4836c2635bad1df3a424e50cbdd167ffccb4dfff57d36b4aae0d6ca0910698220171a0f3373c1060a046c2812f0027e321f72979daa5e7973214170d49e885de0c0ecc167837d44502430674a82522e5df6a0759548052420b91ec1"));
18221822}
18231823
1824test "big.int div multi-multi fuzz case #2" {
1824test "div multi-multi fuzz case #2" {
18251825 var a = try Managed.init(testing.allocator);
18261826 defer a.deinit();
18271827 var b = try Managed.init(testing.allocator);
......@@ -1845,7 +1845,7 @@ test "big.int div multi-multi fuzz case #2" {
18451845 try testing.expect(std.mem.eql(u8, rs, "a900000000000000000000000000000000000000000000000000"));
18461846}
18471847
1848test "big.int truncate single unsigned" {
1848test "truncate single unsigned" {
18491849 var a = try Managed.initSet(testing.allocator, maxInt(u47));
18501850 defer a.deinit();
18511851
......@@ -1854,7 +1854,7 @@ test "big.int truncate single unsigned" {
18541854 try testing.expect((try a.to(u17)) == maxInt(u17));
18551855}
18561856
1857test "big.int truncate single signed" {
1857test "truncate single signed" {
18581858 var a = try Managed.initSet(testing.allocator, 0x1_0000);
18591859 defer a.deinit();
18601860
......@@ -1863,7 +1863,7 @@ test "big.int truncate single signed" {
18631863 try testing.expect((try a.to(i17)) == minInt(i17));
18641864}
18651865
1866test "big.int truncate multi to single unsigned" {
1866test "truncate multi to single unsigned" {
18671867 var a = try Managed.initSet(testing.allocator, (maxInt(Limb) + 1) | 0x1234_5678_9ABC_DEF0);
18681868 defer a.deinit();
18691869
......@@ -1872,7 +1872,7 @@ test "big.int truncate multi to single unsigned" {
18721872 try testing.expect((try a.to(u27)) == 0x2BC_DEF0);
18731873}
18741874
1875test "big.int truncate multi to single signed" {
1875test "truncate multi to single signed" {
18761876 var a = try Managed.initSet(testing.allocator, maxInt(Limb) << 10);
18771877 defer a.deinit();
18781878
......@@ -1881,7 +1881,7 @@ test "big.int truncate multi to single signed" {
18811881 try testing.expect((try a.to(i11)) == minInt(i11));
18821882}
18831883
1884test "big.int truncate multi to multi unsigned" {
1884test "truncate multi to multi unsigned" {
18851885 const bits = @typeInfo(SignedDoubleLimb).Int.bits;
18861886 const Int = std.meta.Int(.unsigned, bits - 1);
18871887
......@@ -1893,7 +1893,7 @@ test "big.int truncate multi to multi unsigned" {
18931893 try testing.expect((try a.to(Int)) == maxInt(Int));
18941894}
18951895
1896test "big.int truncate multi to multi signed" {
1896test "truncate multi to multi signed" {
18971897 var a = try Managed.initSet(testing.allocator, 3 << @bitSizeOf(Limb));
18981898 defer a.deinit();
18991899
......@@ -1902,7 +1902,7 @@ test "big.int truncate multi to multi signed" {
19021902 try testing.expect((try a.to(std.meta.Int(.signed, @bitSizeOf(Limb) + 1))) == -1 << @bitSizeOf(Limb));
19031903}
19041904
1905test "big.int truncate negative multi to single" {
1905test "truncate negative multi to single" {
19061906 var a = try Managed.initSet(testing.allocator, -@as(SignedDoubleLimb, maxInt(Limb) + 1));
19071907 defer a.deinit();
19081908
......@@ -1911,7 +1911,7 @@ test "big.int truncate negative multi to single" {
19111911 try testing.expect((try a.to(i17)) == 0);
19121912}
19131913
1914test "big.int truncate multi unsigned many" {
1914test "truncate multi unsigned many" {
19151915 var a = try Managed.initSet(testing.allocator, 1);
19161916 defer a.deinit();
19171917 try a.shiftLeft(&a, 1023);
......@@ -1923,7 +1923,7 @@ test "big.int truncate multi unsigned many" {
19231923 try testing.expect((try b.to(i1)) == 0);
19241924}
19251925
1926test "big.int saturate single signed positive" {
1926test "saturate single signed positive" {
19271927 var a = try Managed.initSet(testing.allocator, 0xBBBB_BBBB);
19281928 defer a.deinit();
19291929
......@@ -1932,7 +1932,7 @@ test "big.int saturate single signed positive" {
19321932 try testing.expect((try a.to(i17)) == maxInt(i17));
19331933}
19341934
1935test "big.int saturate single signed negative" {
1935test "saturate single signed negative" {
19361936 var a = try Managed.initSet(testing.allocator, -1_234_567);
19371937 defer a.deinit();
19381938
......@@ -1941,7 +1941,7 @@ test "big.int saturate single signed negative" {
19411941 try testing.expect((try a.to(i17)) == minInt(i17));
19421942}
19431943
1944test "big.int saturate single signed" {
1944test "saturate single signed" {
19451945 var a = try Managed.initSet(testing.allocator, maxInt(i17) - 1);
19461946 defer a.deinit();
19471947
......@@ -1950,7 +1950,7 @@ test "big.int saturate single signed" {
19501950 try testing.expect((try a.to(i17)) == maxInt(i17) - 1);
19511951}
19521952
1953test "big.int saturate multi signed" {
1953test "saturate multi signed" {
19541954 var a = try Managed.initSet(testing.allocator, maxInt(Limb) << @bitSizeOf(SignedDoubleLimb));
19551955 defer a.deinit();
19561956
......@@ -1959,7 +1959,7 @@ test "big.int saturate multi signed" {
19591959 try testing.expect((try a.to(SignedDoubleLimb)) == maxInt(SignedDoubleLimb));
19601960}
19611961
1962test "big.int saturate single unsigned" {
1962test "saturate single unsigned" {
19631963 var a = try Managed.initSet(testing.allocator, 0xFEFE_FEFE);
19641964 defer a.deinit();
19651965
......@@ -1968,7 +1968,7 @@ test "big.int saturate single unsigned" {
19681968 try testing.expect((try a.to(u23)) == maxInt(u23));
19691969}
19701970
1971test "big.int saturate multi unsigned zero" {
1971test "saturate multi unsigned zero" {
19721972 var a = try Managed.initSet(testing.allocator, -1);
19731973 defer a.deinit();
19741974
......@@ -1977,7 +1977,7 @@ test "big.int saturate multi unsigned zero" {
19771977 try testing.expect(a.eqlZero());
19781978}
19791979
1980test "big.int saturate multi unsigned" {
1980test "saturate multi unsigned" {
19811981 var a = try Managed.initSet(testing.allocator, maxInt(Limb) << @bitSizeOf(DoubleLimb));
19821982 defer a.deinit();
19831983
......@@ -1986,7 +1986,7 @@ test "big.int saturate multi unsigned" {
19861986 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb));
19871987}
19881988
1989test "big.int shift-right single" {
1989test "shift-right single" {
19901990 var a = try Managed.initSet(testing.allocator, 0xffff0000);
19911991 defer a.deinit();
19921992 try a.shiftRight(&a, 16);
......@@ -1994,7 +1994,7 @@ test "big.int shift-right single" {
19941994 try testing.expect((try a.to(u32)) == 0xffff);
19951995}
19961996
1997test "big.int shift-right multi" {
1997test "shift-right multi" {
19981998 var a = try Managed.initSet(testing.allocator, 0xffff0000eeee1111dddd2222cccc3333);
19991999 defer a.deinit();
20002000 try a.shiftRight(&a, 67);
......@@ -2008,7 +2008,7 @@ test "big.int shift-right multi" {
20082008 try testing.expect(a.eqlZero());
20092009}
20102010
2011test "big.int shift-left single" {
2011test "shift-left single" {
20122012 var a = try Managed.initSet(testing.allocator, 0xffff);
20132013 defer a.deinit();
20142014 try a.shiftLeft(&a, 16);
......@@ -2016,7 +2016,7 @@ test "big.int shift-left single" {
20162016 try testing.expect((try a.to(u64)) == 0xffff0000);
20172017}
20182018
2019test "big.int shift-left multi" {
2019test "shift-left multi" {
20202020 var a = try Managed.initSet(testing.allocator, 0x1fffe0001dddc222);
20212021 defer a.deinit();
20222022 try a.shiftLeft(&a, 67);
......@@ -2024,7 +2024,7 @@ test "big.int shift-left multi" {
20242024 try testing.expect((try a.to(u128)) == 0xffff0000eeee11100000000000000000);
20252025}
20262026
2027test "big.int shift-right negative" {
2027test "shift-right negative" {
20282028 var a = try Managed.init(testing.allocator);
20292029 defer a.deinit();
20302030
......@@ -2044,7 +2044,7 @@ test "big.int shift-right negative" {
20442044 try testing.expect((try a.to(i32)) == -1); // -10 >> 1232 == -1
20452045}
20462046
2047test "big.int sat shift-left simple unsigned" {
2047test "sat shift-left simple unsigned" {
20482048 var a = try Managed.initSet(testing.allocator, 0xffff);
20492049 defer a.deinit();
20502050 try a.shiftLeftSat(&a, 16, .unsigned, 21);
......@@ -2052,7 +2052,7 @@ test "big.int sat shift-left simple unsigned" {
20522052 try testing.expect((try a.to(u64)) == 0x1fffff);
20532053}
20542054
2055test "big.int sat shift-left simple unsigned no sat" {
2055test "sat shift-left simple unsigned no sat" {
20562056 var a = try Managed.initSet(testing.allocator, 1);
20572057 defer a.deinit();
20582058 try a.shiftLeftSat(&a, 16, .unsigned, 21);
......@@ -2060,7 +2060,7 @@ test "big.int sat shift-left simple unsigned no sat" {
20602060 try testing.expect((try a.to(u64)) == 0x10000);
20612061}
20622062
2063test "big.int sat shift-left multi unsigned" {
2063test "sat shift-left multi unsigned" {
20642064 var a = try Managed.initSet(testing.allocator, 16);
20652065 defer a.deinit();
20662066 try a.shiftLeftSat(&a, @bitSizeOf(DoubleLimb) - 3, .unsigned, @bitSizeOf(DoubleLimb) - 1);
......@@ -2068,7 +2068,7 @@ test "big.int sat shift-left multi unsigned" {
20682068 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb) >> 1);
20692069}
20702070
2071test "big.int sat shift-left unsigned shift > bitcount" {
2071test "sat shift-left unsigned shift > bitcount" {
20722072 var a = try Managed.initSet(testing.allocator, 1);
20732073 defer a.deinit();
20742074 try a.shiftLeftSat(&a, 10, .unsigned, 10);
......@@ -2076,7 +2076,7 @@ test "big.int sat shift-left unsigned shift > bitcount" {
20762076 try testing.expect((try a.to(u10)) == maxInt(u10));
20772077}
20782078
2079test "big.int sat shift-left unsigned zero" {
2079test "sat shift-left unsigned zero" {
20802080 var a = try Managed.initSet(testing.allocator, 0);
20812081 defer a.deinit();
20822082 try a.shiftLeftSat(&a, 1, .unsigned, 0);
......@@ -2084,7 +2084,7 @@ test "big.int sat shift-left unsigned zero" {
20842084 try testing.expect((try a.to(u64)) == 0);
20852085}
20862086
2087test "big.int sat shift-left unsigned negative" {
2087test "sat shift-left unsigned negative" {
20882088 var a = try Managed.initSet(testing.allocator, -100);
20892089 defer a.deinit();
20902090 try a.shiftLeftSat(&a, 0, .unsigned, 0);
......@@ -2092,7 +2092,7 @@ test "big.int sat shift-left unsigned negative" {
20922092 try testing.expect((try a.to(u64)) == 0);
20932093}
20942094
2095test "big.int sat shift-left signed simple negative" {
2095test "sat shift-left signed simple negative" {
20962096 var a = try Managed.initSet(testing.allocator, -100);
20972097 defer a.deinit();
20982098 try a.shiftLeftSat(&a, 3, .signed, 10);
......@@ -2100,7 +2100,7 @@ test "big.int sat shift-left signed simple negative" {
21002100 try testing.expect((try a.to(i10)) == minInt(i10));
21012101}
21022102
2103test "big.int sat shift-left signed simple positive" {
2103test "sat shift-left signed simple positive" {
21042104 var a = try Managed.initSet(testing.allocator, 100);
21052105 defer a.deinit();
21062106 try a.shiftLeftSat(&a, 3, .signed, 10);
......@@ -2108,7 +2108,7 @@ test "big.int sat shift-left signed simple positive" {
21082108 try testing.expect((try a.to(i10)) == maxInt(i10));
21092109}
21102110
2111test "big.int sat shift-left signed multi positive" {
2111test "sat shift-left signed multi positive" {
21122112 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
21132113
21142114 var x: SignedDoubleLimb = 1;
......@@ -2123,7 +2123,7 @@ test "big.int sat shift-left signed multi positive" {
21232123 try testing.expect((try a.to(SignedDoubleLimb)) == x <<| shift);
21242124}
21252125
2126test "big.int sat shift-left signed multi negative" {
2126test "sat shift-left signed multi negative" {
21272127 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest;
21282128
21292129 var x: SignedDoubleLimb = -1;
......@@ -2138,7 +2138,7 @@ test "big.int sat shift-left signed multi negative" {
21382138 try testing.expect((try a.to(SignedDoubleLimb)) == x <<| shift);
21392139}
21402140
2141test "big.int bitNotWrap unsigned simple" {
2141test "bitNotWrap unsigned simple" {
21422142 var x: u10 = 123;
21432143 _ = &x;
21442144
......@@ -2150,7 +2150,7 @@ test "big.int bitNotWrap unsigned simple" {
21502150 try testing.expect((try a.to(u10)) == ~x);
21512151}
21522152
2153test "big.int bitNotWrap unsigned multi" {
2153test "bitNotWrap unsigned multi" {
21542154 var a = try Managed.initSet(testing.allocator, 0);
21552155 defer a.deinit();
21562156
......@@ -2159,7 +2159,7 @@ test "big.int bitNotWrap unsigned multi" {
21592159 try testing.expect((try a.to(DoubleLimb)) == maxInt(DoubleLimb));
21602160}
21612161
2162test "big.int bitNotWrap signed simple" {
2162test "bitNotWrap signed simple" {
21632163 var x: i11 = -456;
21642164 _ = &x;
21652165
......@@ -2171,7 +2171,7 @@ test "big.int bitNotWrap signed simple" {
21712171 try testing.expect((try a.to(i11)) == ~x);
21722172}
21732173
2174test "big.int bitNotWrap signed multi" {
2174test "bitNotWrap signed multi" {
21752175 var a = try Managed.initSet(testing.allocator, 0);
21762176 defer a.deinit();
21772177
......@@ -2180,7 +2180,7 @@ test "big.int bitNotWrap signed multi" {
21802180 try testing.expect((try a.to(SignedDoubleLimb)) == -1);
21812181}
21822182
2183test "big.int bitNotWrap more than two limbs" {
2183test "bitNotWrap more than two limbs" {
21842184 // This test requires int sizes greater than 128 bits.
21852185 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; // TODO
21862186 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest; // TODO
......@@ -2206,7 +2206,7 @@ test "big.int bitNotWrap more than two limbs" {
22062206 try testing.expectEqual((try res.to(Signed)), ~@as(Signed, maxInt(Limb)));
22072207}
22082208
2209test "big.int bitwise and simple" {
2209test "bitwise and simple" {
22102210 var a = try Managed.initSet(testing.allocator, 0xffffffff11111111);
22112211 defer a.deinit();
22122212 var b = try Managed.initSet(testing.allocator, 0xeeeeeeee22222222);
......@@ -2217,7 +2217,7 @@ test "big.int bitwise and simple" {
22172217 try testing.expect((try a.to(u64)) == 0xeeeeeeee00000000);
22182218}
22192219
2220test "big.int bitwise and multi-limb" {
2220test "bitwise and multi-limb" {
22212221 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
22222222 defer a.deinit();
22232223 var b = try Managed.initSet(testing.allocator, maxInt(Limb));
......@@ -2228,7 +2228,7 @@ test "big.int bitwise and multi-limb" {
22282228 try testing.expect((try a.to(u128)) == 0);
22292229}
22302230
2231test "big.int bitwise and negative-positive simple" {
2231test "bitwise and negative-positive simple" {
22322232 var a = try Managed.initSet(testing.allocator, -0xffffffff11111111);
22332233 defer a.deinit();
22342234 var b = try Managed.initSet(testing.allocator, 0xeeeeeeee22222222);
......@@ -2239,7 +2239,7 @@ test "big.int bitwise and negative-positive simple" {
22392239 try testing.expect((try a.to(u64)) == 0x22222222);
22402240}
22412241
2242test "big.int bitwise and negative-positive multi-limb" {
2242test "bitwise and negative-positive multi-limb" {
22432243 var a = try Managed.initSet(testing.allocator, -maxInt(Limb) - 1);
22442244 defer a.deinit();
22452245 var b = try Managed.initSet(testing.allocator, maxInt(Limb));
......@@ -2250,7 +2250,7 @@ test "big.int bitwise and negative-positive multi-limb" {
22502250 try testing.expect(a.eqlZero());
22512251}
22522252
2253test "big.int bitwise and positive-negative simple" {
2253test "bitwise and positive-negative simple" {
22542254 var a = try Managed.initSet(testing.allocator, 0xffffffff11111111);
22552255 defer a.deinit();
22562256 var b = try Managed.initSet(testing.allocator, -0xeeeeeeee22222222);
......@@ -2261,7 +2261,7 @@ test "big.int bitwise and positive-negative simple" {
22612261 try testing.expect((try a.to(u64)) == 0x1111111111111110);
22622262}
22632263
2264test "big.int bitwise and positive-negative multi-limb" {
2264test "bitwise and positive-negative multi-limb" {
22652265 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
22662266 defer a.deinit();
22672267 var b = try Managed.initSet(testing.allocator, -maxInt(Limb) - 1);
......@@ -2272,7 +2272,7 @@ test "big.int bitwise and positive-negative multi-limb" {
22722272 try testing.expect(a.eqlZero());
22732273}
22742274
2275test "big.int bitwise and negative-negative simple" {
2275test "bitwise and negative-negative simple" {
22762276 var a = try Managed.initSet(testing.allocator, -0xffffffff11111111);
22772277 defer a.deinit();
22782278 var b = try Managed.initSet(testing.allocator, -0xeeeeeeee22222222);
......@@ -2283,7 +2283,7 @@ test "big.int bitwise and negative-negative simple" {
22832283 try testing.expect((try a.to(i128)) == -0xffffffff33333332);
22842284}
22852285
2286test "big.int bitwise and negative-negative multi-limb" {
2286test "bitwise and negative-negative multi-limb" {
22872287 var a = try Managed.initSet(testing.allocator, -maxInt(Limb) - 1);
22882288 defer a.deinit();
22892289 var b = try Managed.initSet(testing.allocator, -maxInt(Limb) - 2);
......@@ -2294,7 +2294,7 @@ test "big.int bitwise and negative-negative multi-limb" {
22942294 try testing.expect((try a.to(i128)) == -maxInt(Limb) * 2 - 2);
22952295}
22962296
2297test "big.int bitwise and negative overflow" {
2297test "bitwise and negative overflow" {
22982298 var a = try Managed.initSet(testing.allocator, -maxInt(Limb));
22992299 defer a.deinit();
23002300 var b = try Managed.initSet(testing.allocator, -2);
......@@ -2305,7 +2305,7 @@ test "big.int bitwise and negative overflow" {
23052305 try testing.expect((try a.to(SignedDoubleLimb)) == -maxInt(Limb) - 1);
23062306}
23072307
2308test "big.int bitwise xor simple" {
2308test "bitwise xor simple" {
23092309 var a = try Managed.initSet(testing.allocator, 0xffffffff11111111);
23102310 defer a.deinit();
23112311 var b = try Managed.initSet(testing.allocator, 0xeeeeeeee22222222);
......@@ -2316,7 +2316,7 @@ test "big.int bitwise xor simple" {
23162316 try testing.expect((try a.to(u64)) == 0x1111111133333333);
23172317}
23182318
2319test "big.int bitwise xor multi-limb" {
2319test "bitwise xor multi-limb" {
23202320 var x: DoubleLimb = maxInt(Limb) + 1;
23212321 var y: DoubleLimb = maxInt(Limb);
23222322 _ = .{ &x, &y };
......@@ -2331,7 +2331,7 @@ test "big.int bitwise xor multi-limb" {
23312331 try testing.expect((try a.to(DoubleLimb)) == x ^ y);
23322332}
23332333
2334test "big.int bitwise xor single negative simple" {
2334test "bitwise xor single negative simple" {
23352335 var a = try Managed.initSet(testing.allocator, 0x6b03e381328a3154);
23362336 defer a.deinit();
23372337 var b = try Managed.initSet(testing.allocator, -0x45fd3acef9191fad);
......@@ -2342,7 +2342,7 @@ test "big.int bitwise xor single negative simple" {
23422342 try testing.expect((try a.to(i64)) == -0x2efed94fcb932ef9);
23432343}
23442344
2345test "big.int bitwise xor single negative multi-limb" {
2345test "bitwise xor single negative multi-limb" {
23462346 var a = try Managed.initSet(testing.allocator, -0x9849c6e7a10d66d0e4260d4846254c32);
23472347 defer a.deinit();
23482348 var b = try Managed.initSet(testing.allocator, 0xf2194e7d1c855272a997fcde16f6d5a8);
......@@ -2353,7 +2353,7 @@ test "big.int bitwise xor single negative multi-limb" {
23532353 try testing.expect((try a.to(i128)) == -0x6a50889abd8834a24db1f19650d3999a);
23542354}
23552355
2356test "big.int bitwise xor single negative overflow" {
2356test "bitwise xor single negative overflow" {
23572357 var a = try Managed.initSet(testing.allocator, maxInt(Limb));
23582358 defer a.deinit();
23592359 var b = try Managed.initSet(testing.allocator, -1);
......@@ -2364,7 +2364,7 @@ test "big.int bitwise xor single negative overflow" {
23642364 try testing.expect((try a.to(SignedDoubleLimb)) == -(maxInt(Limb) + 1));
23652365}
23662366
2367test "big.int bitwise xor double negative simple" {
2367test "bitwise xor double negative simple" {
23682368 var a = try Managed.initSet(testing.allocator, -0x8e48bd5f755ef1f3);
23692369 defer a.deinit();
23702370 var b = try Managed.initSet(testing.allocator, -0x4dd4fa576f3046ac);
......@@ -2375,7 +2375,7 @@ test "big.int bitwise xor double negative simple" {
23752375 try testing.expect((try a.to(u64)) == 0xc39c47081a6eb759);
23762376}
23772377
2378test "big.int bitwise xor double negative multi-limb" {
2378test "bitwise xor double negative multi-limb" {
23792379 var a = try Managed.initSet(testing.allocator, -0x684e5da8f500ec8ca7204c33ccc51c9c);
23802380 defer a.deinit();
23812381 var b = try Managed.initSet(testing.allocator, -0xcb07736a7b62289c78d967c3985eebeb);
......@@ -2386,7 +2386,7 @@ test "big.int bitwise xor double negative multi-limb" {
23862386 try testing.expect((try a.to(u128)) == 0xa3492ec28e62c410dff92bf0549bf771);
23872387}
23882388
2389test "big.int bitwise or simple" {
2389test "bitwise or simple" {
23902390 var a = try Managed.initSet(testing.allocator, 0xffffffff11111111);
23912391 defer a.deinit();
23922392 var b = try Managed.initSet(testing.allocator, 0xeeeeeeee22222222);
......@@ -2397,7 +2397,7 @@ test "big.int bitwise or simple" {
23972397 try testing.expect((try a.to(u64)) == 0xffffffff33333333);
23982398}
23992399
2400test "big.int bitwise or multi-limb" {
2400test "bitwise or multi-limb" {
24012401 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
24022402 defer a.deinit();
24032403 var b = try Managed.initSet(testing.allocator, maxInt(Limb));
......@@ -2408,7 +2408,7 @@ test "big.int bitwise or multi-limb" {
24082408 try testing.expect((try a.to(DoubleLimb)) == (maxInt(Limb) + 1) + maxInt(Limb));
24092409}
24102410
2411test "big.int bitwise or negative-positive simple" {
2411test "bitwise or negative-positive simple" {
24122412 var a = try Managed.initSet(testing.allocator, -0xffffffff11111111);
24132413 defer a.deinit();
24142414 var b = try Managed.initSet(testing.allocator, 0xeeeeeeee22222222);
......@@ -2419,7 +2419,7 @@ test "big.int bitwise or negative-positive simple" {
24192419 try testing.expect((try a.to(i64)) == -0x1111111111111111);
24202420}
24212421
2422test "big.int bitwise or negative-positive multi-limb" {
2422test "bitwise or negative-positive multi-limb" {
24232423 var a = try Managed.initSet(testing.allocator, -maxInt(Limb) - 1);
24242424 defer a.deinit();
24252425 var b = try Managed.initSet(testing.allocator, 1);
......@@ -2430,7 +2430,7 @@ test "big.int bitwise or negative-positive multi-limb" {
24302430 try testing.expect((try a.to(SignedDoubleLimb)) == -maxInt(Limb));
24312431}
24322432
2433test "big.int bitwise or positive-negative simple" {
2433test "bitwise or positive-negative simple" {
24342434 var a = try Managed.initSet(testing.allocator, 0xffffffff11111111);
24352435 defer a.deinit();
24362436 var b = try Managed.initSet(testing.allocator, -0xeeeeeeee22222222);
......@@ -2441,7 +2441,7 @@ test "big.int bitwise or positive-negative simple" {
24412441 try testing.expect((try a.to(i64)) == -0x22222221);
24422442}
24432443
2444test "big.int bitwise or positive-negative multi-limb" {
2444test "bitwise or positive-negative multi-limb" {
24452445 var a = try Managed.initSet(testing.allocator, maxInt(Limb) + 1);
24462446 defer a.deinit();
24472447 var b = try Managed.initSet(testing.allocator, -1);
......@@ -2452,7 +2452,7 @@ test "big.int bitwise or positive-negative multi-limb" {
24522452 try testing.expect((try a.to(SignedDoubleLimb)) == -1);
24532453}
24542454
2455test "big.int bitwise or negative-negative simple" {
2455test "bitwise or negative-negative simple" {
24562456 var a = try Managed.initSet(testing.allocator, -0xffffffff11111111);
24572457 defer a.deinit();
24582458 var b = try Managed.initSet(testing.allocator, -0xeeeeeeee22222222);
......@@ -2463,7 +2463,7 @@ test "big.int bitwise or negative-negative simple" {
24632463 try testing.expect((try a.to(i128)) == -0xeeeeeeee00000001);
24642464}
24652465
2466test "big.int bitwise or negative-negative multi-limb" {
2466test "bitwise or negative-negative multi-limb" {
24672467 var a = try Managed.initSet(testing.allocator, -maxInt(Limb) - 1);
24682468 defer a.deinit();
24692469 var b = try Managed.initSet(testing.allocator, -maxInt(Limb));
......@@ -2474,7 +2474,7 @@ test "big.int bitwise or negative-negative multi-limb" {
24742474 try testing.expect((try a.to(SignedDoubleLimb)) == -maxInt(Limb));
24752475}
24762476
2477test "big.int var args" {
2477test "var args" {
24782478 var a = try Managed.initSet(testing.allocator, 5);
24792479 defer a.deinit();
24802480
......@@ -2492,7 +2492,7 @@ test "big.int var args" {
24922492 try testing.expect(a.order(d) != .gt);
24932493}
24942494
2495test "big.int gcd non-one small" {
2495test "gcd non-one small" {
24962496 var a = try Managed.initSet(testing.allocator, 17);
24972497 defer a.deinit();
24982498 var b = try Managed.initSet(testing.allocator, 97);
......@@ -2505,7 +2505,7 @@ test "big.int gcd non-one small" {
25052505 try testing.expect((try r.to(u32)) == 1);
25062506}
25072507
2508test "big.int gcd non-one medium" {
2508test "gcd non-one medium" {
25092509 var a = try Managed.initSet(testing.allocator, 4864);
25102510 defer a.deinit();
25112511 var b = try Managed.initSet(testing.allocator, 3458);
......@@ -2518,7 +2518,7 @@ test "big.int gcd non-one medium" {
25182518 try testing.expect((try r.to(u32)) == 38);
25192519}
25202520
2521test "big.int gcd non-one large" {
2521test "gcd non-one large" {
25222522 var a = try Managed.initSet(testing.allocator, 0xffffffffffffffff);
25232523 defer a.deinit();
25242524 var b = try Managed.initSet(testing.allocator, 0xffffffffffffffff7777);
......@@ -2531,7 +2531,7 @@ test "big.int gcd non-one large" {
25312531 try testing.expect((try r.to(u32)) == 4369);
25322532}
25332533
2534test "big.int gcd large multi-limb result" {
2534test "gcd large multi-limb result" {
25352535 if (builtin.zig_backend == .stage2_c) return error.SkipZigTest;
25362536
25372537 var a = try Managed.initSet(testing.allocator, 0x12345678123456781234567812345678123456781234567812345678);
......@@ -2547,7 +2547,7 @@ test "big.int gcd large multi-limb result" {
25472547 try testing.expect(answer == 0xf000000ff00000fff0000ffff000fffff00ffffff1);
25482548}
25492549
2550test "big.int gcd one large" {
2550test "gcd one large" {
25512551 var a = try Managed.initSet(testing.allocator, 1897056385327307);
25522552 defer a.deinit();
25532553 var b = try Managed.initSet(testing.allocator, 2251799813685248);
......@@ -2560,7 +2560,7 @@ test "big.int gcd one large" {
25602560 try testing.expect((try r.to(u64)) == 1);
25612561}
25622562
2563test "big.int mutable to managed" {
2563test "mutable to managed" {
25642564 const allocator = testing.allocator;
25652565 const limbs_buf = try allocator.alloc(Limb, 8);
25662566 defer allocator.free(limbs_buf);
......@@ -2571,7 +2571,7 @@ test "big.int mutable to managed" {
25712571 try testing.expect(a.toConst().eql(a_managed.toConst()));
25722572}
25732573
2574test "big.int const to managed" {
2574test "const to managed" {
25752575 var a = try Managed.initSet(testing.allocator, 123423453456);
25762576 defer a.deinit();
25772577
......@@ -2581,7 +2581,7 @@ test "big.int const to managed" {
25812581 try testing.expect(a.toConst().eql(b.toConst()));
25822582}
25832583
2584test "big.int pow" {
2584test "pow" {
25852585 {
25862586 var a = try Managed.initSet(testing.allocator, -3);
25872587 defer a.deinit();
......@@ -2636,7 +2636,7 @@ test "big.int pow" {
26362636 }
26372637}
26382638
2639test "big.int sqrt" {
2639test "sqrt" {
26402640 var r = try Managed.init(testing.allocator);
26412641 defer r.deinit();
26422642 var a = try Managed.init(testing.allocator);
......@@ -2666,7 +2666,7 @@ test "big.int sqrt" {
26662666 try testing.expectEqual(@as(i32, 0x100_0000), try r.to(i32));
26672667}
26682668
2669test "big.int regression test for 1 limb overflow with alias" {
2669test "regression test for 1 limb overflow with alias" {
26702670 // Note these happen to be two consecutive Fibonacci sequence numbers, the
26712671 // first two whose sum exceeds 2**64.
26722672 var a = try Managed.initSet(testing.allocator, 7540113804746346429);
......@@ -2680,7 +2680,7 @@ test "big.int regression test for 1 limb overflow with alias" {
26802680 try testing.expect(a.toConst().orderAgainstScalar(19740274219868223167) == .eq);
26812681}
26822682
2683test "big.int regression test for realloc with alias" {
2683test "regression test for realloc with alias" {
26842684 // Note these happen to be two consecutive Fibonacci sequence numbers, the
26852685 // second of which is the first such number to exceed 2**192.
26862686 var a = try Managed.initSet(testing.allocator, 5611500259351924431073312796924978741056961814867751431689);
......@@ -3099,7 +3099,7 @@ test "big int byte swap" {
30993099 try byteSwapTest(i48, 0x123456789abc, @as(i48, @bitCast(@as(u48, 0xbc9a78563412))));
31003100}
31013101
3102test "big.int mul multi-multi alias r with a and b" {
3102test "mul multi-multi alias r with a and b" {
31033103 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
31043104 defer a.deinit();
31053105
......@@ -3115,7 +3115,7 @@ test "big.int mul multi-multi alias r with a and b" {
31153115 }
31163116}
31173117
3118test "big.int sqr multi alias r with a" {
3118test "sqr multi alias r with a" {
31193119 var a = try Managed.initSet(testing.allocator, 2 * maxInt(Limb));
31203120 defer a.deinit();
31213121
......@@ -3131,7 +3131,7 @@ test "big.int sqr multi alias r with a" {
31313131 }
31323132}
31333133
3134test "big.int eql zeroes #17296" {
3134test "eql zeroes #17296" {
31353135 var zero = try Managed.init(testing.allocator);
31363136 defer zero.deinit();
31373137 try zero.setString(10, "0");
......@@ -3152,7 +3152,7 @@ test "big.int eql zeroes #17296" {
31523152 }
31533153}
31543154
3155test "big.int.Const.order 0 == -0" {
3155test "Const.order 0 == -0" {
31563156 const a = std.math.big.int.Const{
31573157 .limbs = &.{0},
31583158 .positive = true,
......@@ -3164,7 +3164,7 @@ test "big.int.Const.order 0 == -0" {
31643164 try std.testing.expectEqual(std.math.Order.eq, a.order(b));
31653165}
31663166
3167test "big.int.Managed sqrt(0) = 0" {
3167test "Managed sqrt(0) = 0" {
31683168 const allocator = testing.allocator;
31693169 var a = try Managed.initSet(allocator, 1);
31703170 defer a.deinit();
......@@ -3178,7 +3178,7 @@ test "big.int.Managed sqrt(0) = 0" {
31783178 try testing.expectEqual(@as(i32, 0), try res.to(i32));
31793179}
31803180
3181test "big.int.Managed sqrt(-1) = error" {
3181test "Managed sqrt(-1) = error" {
31823182 const allocator = testing.allocator;
31833183 var a = try Managed.initSet(allocator, 1);
31843184 defer a.deinit();
......@@ -3191,7 +3191,7 @@ test "big.int.Managed sqrt(-1) = error" {
31913191 try testing.expectError(error.SqrtOfNegativeNumber, res.sqrt(&a));
31923192}
31933193
3194test "big.int.Managed sqrt(n) succeed with res.bitCountAbs() >= usize bits" {
3194test "Managed sqrt(n) succeed with res.bitCountAbs() >= usize bits" {
31953195 const allocator = testing.allocator;
31963196 var a = try Managed.initSet(allocator, 1);
31973197 defer a.deinit();
lib/std/math/big/rational.zig+17-17
......@@ -493,7 +493,7 @@ fn extractLowBits(a: Int, comptime T: type) T {
493493 }
494494}
495495
496test "big.rational extractLowBits" {
496test "extractLowBits" {
497497 var a = try Int.initSet(testing.allocator, 0x11112222333344441234567887654321);
498498 defer a.deinit();
499499
......@@ -513,7 +513,7 @@ test "big.rational extractLowBits" {
513513 try testing.expect(a5 == 0x11112222333344441234567887654321);
514514}
515515
516test "big.rational set" {
516test "set" {
517517 var a = try Rational.init(testing.allocator);
518518 defer a.deinit();
519519
......@@ -542,7 +542,7 @@ test "big.rational set" {
542542 try testing.expect((try a.q.to(i32)) == 1);
543543}
544544
545test "big.rational setFloat" {
545test "setFloat" {
546546 var a = try Rational.init(testing.allocator);
547547 defer a.deinit();
548548
......@@ -567,7 +567,7 @@ test "big.rational setFloat" {
567567 try testing.expect((try a.q.to(u128)) == 70368744177664);
568568}
569569
570test "big.rational setFloatString" {
570test "setFloatString" {
571571 var a = try Rational.init(testing.allocator);
572572 defer a.deinit();
573573
......@@ -578,7 +578,7 @@ test "big.rational setFloatString" {
578578 try testing.expect((try a.q.to(u128)) == 100000000000000000000000000000000000);
579579}
580580
581test "big.rational toFloat" {
581test "toFloat" {
582582 var a = try Rational.init(testing.allocator);
583583 defer a.deinit();
584584
......@@ -591,7 +591,7 @@ test "big.rational toFloat" {
591591 try testing.expect((try a.toFloat(f64)) == 72.141593120712409172417410926841290461290467124);
592592}
593593
594test "big.rational set/to Float round-trip" {
594test "set/to Float round-trip" {
595595 var a = try Rational.init(testing.allocator);
596596 defer a.deinit();
597597 var prng = std.Random.DefaultPrng.init(0x5EED);
......@@ -604,7 +604,7 @@ test "big.rational set/to Float round-trip" {
604604 }
605605}
606606
607test "big.rational copy" {
607test "copy" {
608608 var a = try Rational.init(testing.allocator);
609609 defer a.deinit();
610610
......@@ -634,7 +634,7 @@ test "big.rational copy" {
634634 try testing.expect((try a.q.to(u32)) == 1);
635635}
636636
637test "big.rational negate" {
637test "negate" {
638638 var a = try Rational.init(testing.allocator);
639639 defer a.deinit();
640640
......@@ -651,7 +651,7 @@ test "big.rational negate" {
651651 try testing.expect((try a.q.to(i32)) == 1);
652652}
653653
654test "big.rational abs" {
654test "abs" {
655655 var a = try Rational.init(testing.allocator);
656656 defer a.deinit();
657657
......@@ -668,7 +668,7 @@ test "big.rational abs" {
668668 try testing.expect((try a.q.to(i32)) == 1);
669669}
670670
671test "big.rational swap" {
671test "swap" {
672672 var a = try Rational.init(testing.allocator);
673673 defer a.deinit();
674674 var b = try Rational.init(testing.allocator);
......@@ -692,7 +692,7 @@ test "big.rational swap" {
692692 try testing.expect((try b.q.to(u32)) == 23);
693693}
694694
695test "big.rational order" {
695test "order" {
696696 var a = try Rational.init(testing.allocator);
697697 defer a.deinit();
698698 var b = try Rational.init(testing.allocator);
......@@ -707,7 +707,7 @@ test "big.rational order" {
707707 try testing.expect((try a.order(b)) == .eq);
708708}
709709
710test "big.rational order/orderAbs with negative" {
710test "order/orderAbs with negative" {
711711 var a = try Rational.init(testing.allocator);
712712 defer a.deinit();
713713 var b = try Rational.init(testing.allocator);
......@@ -719,7 +719,7 @@ test "big.rational order/orderAbs with negative" {
719719 try testing.expect((try a.orderAbs(b)) == .lt);
720720}
721721
722test "big.rational add single-limb" {
722test "add single-limb" {
723723 var a = try Rational.init(testing.allocator);
724724 defer a.deinit();
725725 var b = try Rational.init(testing.allocator);
......@@ -734,7 +734,7 @@ test "big.rational add single-limb" {
734734 try testing.expect((try a.order(b)) == .eq);
735735}
736736
737test "big.rational add" {
737test "add" {
738738 var a = try Rational.init(testing.allocator);
739739 defer a.deinit();
740740 var b = try Rational.init(testing.allocator);
......@@ -750,7 +750,7 @@ test "big.rational add" {
750750 try testing.expect((try a.order(r)) == .eq);
751751}
752752
753test "big.rational sub" {
753test "sub" {
754754 var a = try Rational.init(testing.allocator);
755755 defer a.deinit();
756756 var b = try Rational.init(testing.allocator);
......@@ -766,7 +766,7 @@ test "big.rational sub" {
766766 try testing.expect((try a.order(r)) == .eq);
767767}
768768
769test "big.rational mul" {
769test "mul" {
770770 var a = try Rational.init(testing.allocator);
771771 defer a.deinit();
772772 var b = try Rational.init(testing.allocator);
......@@ -782,7 +782,7 @@ test "big.rational mul" {
782782 try testing.expect((try a.order(r)) == .eq);
783783}
784784
785test "big.rational div" {
785test "div" {
786786 {
787787 var a = try Rational.init(testing.allocator);
788788 defer a.deinit();
lib/std/math/cbrt.zig+5-5
......@@ -119,12 +119,12 @@ fn cbrt64(x: f64) f64 {
119119 return t + t * q;
120120}
121121
122test "math.cbrt" {
122test "cbrt" {
123123 try expect(cbrt(@as(f32, 0.0)) == cbrt32(0.0));
124124 try expect(cbrt(@as(f64, 0.0)) == cbrt64(0.0));
125125}
126126
127test "math.cbrt32" {
127test "cbrt32" {
128128 const epsilon = 0.000001;
129129
130130 try expect(math.isPositiveZero(cbrt32(0.0)));
......@@ -135,7 +135,7 @@ test "math.cbrt32" {
135135 try expect(math.approxEqAbs(f32, cbrt32(123123.234375), 49.748501, epsilon));
136136}
137137
138test "math.cbrt64" {
138test "cbrt64" {
139139 const epsilon = 0.000001;
140140
141141 try expect(math.isPositiveZero(cbrt64(0.0)));
......@@ -146,7 +146,7 @@ test "math.cbrt64" {
146146 try expect(math.approxEqAbs(f64, cbrt64(123123.234375), 49.748501, epsilon));
147147}
148148
149test "math.cbrt.special" {
149test "cbrt.special" {
150150 try expect(math.isPositiveZero(cbrt32(0.0)));
151151 try expect(@as(u32, @bitCast(cbrt32(-0.0))) == @as(u32, 0x80000000));
152152 try expect(math.isPositiveInf(cbrt32(math.inf(f32))));
......@@ -154,7 +154,7 @@ test "math.cbrt.special" {
154154 try expect(math.isNan(cbrt32(math.nan(f32))));
155155}
156156
157test "math.cbrt64.special" {
157test "cbrt64.special" {
158158 try expect(math.isPositiveZero(cbrt64(0.0)));
159159 try expect(math.isNegativeZero(cbrt64(-0.0)));
160160 try expect(math.isPositiveInf(cbrt64(math.inf(f64))));
lib/std/math/complex.zig+9-9
......@@ -120,7 +120,7 @@ pub fn Complex(comptime T: type) type {
120120
121121const epsilon = 0.0001;
122122
123test "complex.add" {
123test "add" {
124124 const a = Complex(f32).init(5, 3);
125125 const b = Complex(f32).init(2, 7);
126126 const c = a.add(b);
......@@ -128,7 +128,7 @@ test "complex.add" {
128128 try testing.expect(c.re == 7 and c.im == 10);
129129}
130130
131test "complex.sub" {
131test "sub" {
132132 const a = Complex(f32).init(5, 3);
133133 const b = Complex(f32).init(2, 7);
134134 const c = a.sub(b);
......@@ -136,7 +136,7 @@ test "complex.sub" {
136136 try testing.expect(c.re == 3 and c.im == -4);
137137}
138138
139test "complex.mul" {
139test "mul" {
140140 const a = Complex(f32).init(5, 3);
141141 const b = Complex(f32).init(2, 7);
142142 const c = a.mul(b);
......@@ -144,7 +144,7 @@ test "complex.mul" {
144144 try testing.expect(c.re == -11 and c.im == 41);
145145}
146146
147test "complex.div" {
147test "div" {
148148 const a = Complex(f32).init(5, 3);
149149 const b = Complex(f32).init(2, 7);
150150 const c = a.div(b);
......@@ -153,28 +153,28 @@ test "complex.div" {
153153 math.approxEqAbs(f32, c.im, @as(f32, -29) / 53, epsilon));
154154}
155155
156test "complex.conjugate" {
156test "conjugate" {
157157 const a = Complex(f32).init(5, 3);
158158 const c = a.conjugate();
159159
160160 try testing.expect(c.re == 5 and c.im == -3);
161161}
162162
163test "complex.neg" {
163test "neg" {
164164 const a = Complex(f32).init(5, 3);
165165 const c = a.neg();
166166
167167 try testing.expect(c.re == -5 and c.im == -3);
168168}
169169
170test "complex.mulbyi" {
170test "mulbyi" {
171171 const a = Complex(f32).init(5, 3);
172172 const c = a.mulbyi();
173173
174174 try testing.expect(c.re == -3 and c.im == 5);
175175}
176176
177test "complex.reciprocal" {
177test "reciprocal" {
178178 const a = Complex(f32).init(5, 3);
179179 const c = a.reciprocal();
180180
......@@ -182,7 +182,7 @@ test "complex.reciprocal" {
182182 math.approxEqAbs(f32, c.im, @as(f32, -3) / 34, epsilon));
183183}
184184
185test "complex.magnitude" {
185test "magnitude" {
186186 const a = Complex(f32).init(5, 3);
187187 const c = a.magnitude();
188188
lib/std/math/complex/abs.zig+1-1
......@@ -11,7 +11,7 @@ pub fn abs(z: anytype) @TypeOf(z.re, z.im) {
1111
1212const epsilon = 0.0001;
1313
14test "complex.cabs" {
14test abs {
1515 const a = Complex(f32).init(5, 3);
1616 const c = abs(a);
1717 try testing.expect(math.approxEqAbs(f32, c, 5.83095, epsilon));
lib/std/math/complex/acos.zig+1-1
......@@ -13,7 +13,7 @@ pub fn acos(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1313
1414const epsilon = 0.0001;
1515
16test "complex.cacos" {
16test acos {
1717 const a = Complex(f32).init(5, 3);
1818 const c = acos(a);
1919
lib/std/math/complex/acosh.zig+1-1
......@@ -13,7 +13,7 @@ pub fn acosh(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1313
1414const epsilon = 0.0001;
1515
16test "complex.cacosh" {
16test acosh {
1717 const a = Complex(f32).init(5, 3);
1818 const c = acosh(a);
1919
lib/std/math/complex/arg.zig+1-1
......@@ -11,7 +11,7 @@ pub fn arg(z: anytype) @TypeOf(z.re, z.im) {
1111
1212const epsilon = 0.0001;
1313
14test "complex.carg" {
14test arg {
1515 const a = Complex(f32).init(5, 3);
1616 const c = arg(a);
1717 try testing.expect(math.approxEqAbs(f32, c, 0.540420, epsilon));
lib/std/math/complex/asin.zig+1-1
......@@ -19,7 +19,7 @@ pub fn asin(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1919
2020const epsilon = 0.0001;
2121
22test "complex.casin" {
22test asin {
2323 const a = Complex(f32).init(5, 3);
2424 const c = asin(a);
2525
lib/std/math/complex/asinh.zig+1-1
......@@ -14,7 +14,7 @@ pub fn asinh(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1414
1515const epsilon = 0.0001;
1616
17test "complex.casinh" {
17test asinh {
1818 const a = Complex(f32).init(5, 3);
1919 const c = asinh(a);
2020
lib/std/math/complex/atan.zig+2-2
......@@ -120,7 +120,7 @@ fn atan64(z: Complex(f64)) Complex(f64) {
120120
121121const epsilon = 0.0001;
122122
123test "complex.catan32" {
123test "atan32" {
124124 const a = Complex(f32).init(5, 3);
125125 const c = atan(a);
126126
......@@ -128,7 +128,7 @@ test "complex.catan32" {
128128 try testing.expect(math.approxEqAbs(f32, c.im, 0.086569, epsilon));
129129}
130130
131test "complex.catan64" {
131test "atan64" {
132132 const a = Complex(f64).init(5, 3);
133133 const c = atan(a);
134134
lib/std/math/complex/atanh.zig+1-1
......@@ -14,7 +14,7 @@ pub fn atanh(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1414
1515const epsilon = 0.0001;
1616
17test "complex.catanh" {
17test "atanh" {
1818 const a = Complex(f32).init(5, 3);
1919 const c = atanh(a);
2020
lib/std/math/complex/conj.zig+1-1
......@@ -10,7 +10,7 @@ pub fn conj(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1010 return Complex(T).init(z.re, -z.im);
1111}
1212
13test "complex.conj" {
13test "onj" {
1414 const a = Complex(f32).init(5, 3);
1515 const c = a.conjugate();
1616
lib/std/math/complex/cos.zig+1-1
......@@ -13,7 +13,7 @@ pub fn cos(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1313
1414const epsilon = 0.0001;
1515
16test "complex.ccos" {
16test "cos" {
1717 const a = Complex(f32).init(5, 3);
1818 const c = cos(a);
1919
lib/std/math/complex/cosh.zig+2-2
......@@ -155,7 +155,7 @@ fn cosh64(z: Complex(f64)) Complex(f64) {
155155
156156const epsilon = 0.0001;
157157
158test "complex.ccosh32" {
158test "cosh32" {
159159 const a = Complex(f32).init(5, 3);
160160 const c = cosh(a);
161161
......@@ -163,7 +163,7 @@ test "complex.ccosh32" {
163163 try testing.expect(math.approxEqAbs(f32, c.im, 10.471557, epsilon));
164164}
165165
166test "complex.ccosh64" {
166test "cosh64" {
167167 const a = Complex(f64).init(5, 3);
168168 const c = cosh(a);
169169
lib/std/math/complex/exp.zig+2-2
......@@ -119,7 +119,7 @@ fn exp64(z: Complex(f64)) Complex(f64) {
119119 }
120120}
121121
122test "complex.cexp32" {
122test "exp32" {
123123 const tolerance_f32 = @sqrt(math.floatEps(f32));
124124
125125 {
......@@ -139,7 +139,7 @@ test "complex.cexp32" {
139139 }
140140}
141141
142test "complex.cexp64" {
142test "exp64" {
143143 const tolerance_f64 = @sqrt(math.floatEps(f64));
144144
145145 {
lib/std/math/complex/log.zig+1-1
......@@ -15,7 +15,7 @@ pub fn log(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1515
1616const epsilon = 0.0001;
1717
18test "complex.clog" {
18test "log" {
1919 const a = Complex(f32).init(5, 3);
2020 const c = log(a);
2121
lib/std/math/complex/pow.zig+1-1
......@@ -11,7 +11,7 @@ pub fn pow(z: anytype, s: anytype) Complex(@TypeOf(z.re, z.im, s.re, s.im)) {
1111
1212const epsilon = 0.0001;
1313
14test "complex.cpow" {
14test "pow" {
1515 const a = Complex(f32).init(5, 3);
1616 const b = Complex(f32).init(2.3, -1.3);
1717 const c = pow(a, b);
lib/std/math/complex/proj.zig+1-1
......@@ -17,7 +17,7 @@ pub fn proj(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1717
1818const epsilon = 0.0001;
1919
20test "complex.cproj" {
20test "proj" {
2121 const a = Complex(f32).init(5, 3);
2222 const c = proj(a);
2323
lib/std/math/complex/sin.zig+1-1
......@@ -14,7 +14,7 @@ pub fn sin(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1414
1515const epsilon = 0.0001;
1616
17test "complex.csin" {
17test "sin" {
1818 const a = Complex(f32).init(5, 3);
1919 const c = sin(a);
2020
lib/std/math/complex/sinh.zig+2-2
......@@ -154,7 +154,7 @@ fn sinh64(z: Complex(f64)) Complex(f64) {
154154
155155const epsilon = 0.0001;
156156
157test "complex.csinh32" {
157test "sinh32" {
158158 const a = Complex(f32).init(5, 3);
159159 const c = sinh(a);
160160
......@@ -162,7 +162,7 @@ test "complex.csinh32" {
162162 try testing.expect(math.approxEqAbs(f32, c.im, 10.472508, epsilon));
163163}
164164
165test "complex.csinh64" {
165test "sinh64" {
166166 const a = Complex(f64).init(5, 3);
167167 const c = sinh(a);
168168
lib/std/math/complex/sqrt.zig+2-2
......@@ -129,7 +129,7 @@ fn sqrt64(z: Complex(f64)) Complex(f64) {
129129
130130const epsilon = 0.0001;
131131
132test "complex.csqrt32" {
132test "sqrt32" {
133133 const a = Complex(f32).init(5, 3);
134134 const c = sqrt(a);
135135
......@@ -137,7 +137,7 @@ test "complex.csqrt32" {
137137 try testing.expect(math.approxEqAbs(f32, c.im, 0.644574, epsilon));
138138}
139139
140test "complex.csqrt64" {
140test "sqrt64" {
141141 const a = Complex(f64).init(5, 3);
142142 const c = sqrt(a);
143143
lib/std/math/complex/tan.zig+1-1
......@@ -14,7 +14,7 @@ pub fn tan(z: anytype) Complex(@TypeOf(z.re, z.im)) {
1414
1515const epsilon = 0.0001;
1616
17test "complex.ctan" {
17test "tan" {
1818 const a = Complex(f32).init(5, 3);
1919 const c = tan(a);
2020
lib/std/math/complex/tanh.zig+2-2
......@@ -103,7 +103,7 @@ fn tanh64(z: Complex(f64)) Complex(f64) {
103103
104104const epsilon = 0.0001;
105105
106test "complex.ctanh32" {
106test "tanh32" {
107107 const a = Complex(f32).init(5, 3);
108108 const c = tanh(a);
109109
......@@ -111,7 +111,7 @@ test "complex.ctanh32" {
111111 try testing.expect(math.approxEqAbs(f32, c.im, -0.000025, epsilon));
112112}
113113
114test "complex.ctanh64" {
114test "tanh64" {
115115 const a = Complex(f64).init(5, 3);
116116 const c = tanh(a);
117117
lib/std/math/copysign.zig+1-1
......@@ -12,7 +12,7 @@ pub fn copysign(magnitude: anytype, sign: @TypeOf(magnitude)) @TypeOf(magnitude)
1212 return @as(T, @bitCast(mag | sgn));
1313}
1414
15test "math.copysign" {
15test copysign {
1616 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
1717 try expect(copysign(@as(T, 1.0), @as(T, 1.0)) == 1.0);
1818 try expect(copysign(@as(T, 2.0), @as(T, -2.0)) == -2.0);
lib/std/math/cosh.zig+5-5
......@@ -86,12 +86,12 @@ fn cosh64(x: f64) f64 {
8686 return expo2(ax);
8787}
8888
89test "math.cosh" {
89test "cosh" {
9090 try expect(cosh(@as(f32, 1.5)) == cosh32(1.5));
9191 try expect(cosh(@as(f64, 1.5)) == cosh64(1.5));
9292}
9393
94test "math.cosh32" {
94test "cosh32" {
9595 const epsilon = 0.000001;
9696
9797 try expect(math.approxEqAbs(f32, cosh32(0.0), 1.0, epsilon));
......@@ -104,7 +104,7 @@ test "math.cosh32" {
104104 try expect(math.approxEqAbs(f32, cosh32(-1.5), 2.352410, epsilon));
105105}
106106
107test "math.cosh64" {
107test "cosh64" {
108108 const epsilon = 0.000001;
109109
110110 try expect(math.approxEqAbs(f64, cosh64(0.0), 1.0, epsilon));
......@@ -117,7 +117,7 @@ test "math.cosh64" {
117117 try expect(math.approxEqAbs(f64, cosh64(-1.5), 2.352410, epsilon));
118118}
119119
120test "math.cosh32.special" {
120test "cosh32.special" {
121121 try expect(cosh32(0.0) == 1.0);
122122 try expect(cosh32(-0.0) == 1.0);
123123 try expect(math.isPositiveInf(cosh32(math.inf(f32))));
......@@ -125,7 +125,7 @@ test "math.cosh32.special" {
125125 try expect(math.isNan(cosh32(math.nan(f32))));
126126}
127127
128test "math.cosh64.special" {
128test "cosh64.special" {
129129 try expect(cosh64(0.0) == 1.0);
130130 try expect(cosh64(-0.0) == 1.0);
131131 try expect(math.isPositiveInf(cosh64(math.inf(f64))));
lib/std/math/expm1.zig+5-5
......@@ -286,12 +286,12 @@ fn expm1_64(x_: f64) f64 {
286286 }
287287}
288288
289test "math.exp1m" {
289test "exp1m" {
290290 try expect(expm1(@as(f32, 0.0)) == expm1_32(0.0));
291291 try expect(expm1(@as(f64, 0.0)) == expm1_64(0.0));
292292}
293293
294test "math.expm1_32" {
294test "expm1_32" {
295295 const epsilon = 0.000001;
296296
297297 try expect(math.isPositiveZero(expm1_32(0.0)));
......@@ -301,7 +301,7 @@ test "math.expm1_32" {
301301 try expect(math.approxEqAbs(f32, expm1_32(1.5), 3.481689, epsilon));
302302}
303303
304test "math.expm1_64" {
304test "expm1_64" {
305305 const epsilon = 0.000001;
306306
307307 try expect(math.isPositiveZero(expm1_64(0.0)));
......@@ -311,13 +311,13 @@ test "math.expm1_64" {
311311 try expect(math.approxEqAbs(f64, expm1_64(1.5), 3.481689, epsilon));
312312}
313313
314test "math.expm1_32.special" {
314test "expm1_32.special" {
315315 try expect(math.isPositiveInf(expm1_32(math.inf(f32))));
316316 try expect(expm1_32(-math.inf(f32)) == -1.0);
317317 try expect(math.isNan(expm1_32(math.nan(f32))));
318318}
319319
320test "math.expm1_64.special" {
320test "expm1_64.special" {
321321 try expect(math.isPositiveInf(expm1_64(math.inf(f64))));
322322 try expect(expm1_64(-math.inf(f64)) == -1.0);
323323 try expect(math.isNan(expm1_64(math.nan(f64))));
lib/std/math/float.zig+3-3
......@@ -132,7 +132,7 @@ test "float bits" {
132132 }
133133}
134134
135test "math.inf" {
135test "inf" {
136136 const inf_u16: u16 = 0x7C00;
137137 const inf_u32: u32 = 0x7F800000;
138138 const inf_u64: u64 = 0x7FF0000000000000;
......@@ -145,7 +145,7 @@ test "math.inf" {
145145 try expectEqual(inf_u128, @as(u128, @bitCast(inf(f128))));
146146}
147147
148test "math.nan" {
148test "nan" {
149149 const qnan_u16: u16 = 0x7E00;
150150 const qnan_u32: u32 = 0x7FC00000;
151151 const qnan_u64: u64 = 0x7FF8000000000000;
......@@ -158,7 +158,7 @@ test "math.nan" {
158158 try expectEqual(qnan_u128, @as(u128, @bitCast(nan(f128))));
159159}
160160
161test "math.snan" {
161test "snan" {
162162 // TODO: https://github.com/ziglang/zig/issues/14366
163163 if (builtin.zig_backend == .stage2_llvm and comptime builtin.cpu.arch.isArmOrThumb()) return error.SkipZigTest;
164164
lib/std/math/gamma.zig+4-4
......@@ -240,7 +240,7 @@ const expect = std.testing.expect;
240240const expectEqual = std.testing.expectEqual;
241241const expectApproxEqRel = std.testing.expectApproxEqRel;
242242
243test "math.gamma" {
243test "gamma" {
244244 inline for (&.{ f32, f64 }) |T| {
245245 const eps = @sqrt(std.math.floatEps(T));
246246 try expectApproxEqRel(@as(T, 120), gamma(T, 6), eps);
......@@ -261,7 +261,7 @@ test "math.gamma" {
261261 }
262262}
263263
264test "math.gamma.special" {
264test "gamma.special" {
265265 inline for (&.{ f32, f64 }) |T| {
266266 try expect(std.math.isNan(gamma(T, -std.math.nan(T))));
267267 try expect(std.math.isNan(gamma(T, std.math.nan(T))));
......@@ -286,7 +286,7 @@ test "math.gamma.special" {
286286 }
287287}
288288
289test "math.lgamma" {
289test "lgamma" {
290290 inline for (&.{ f32, f64 }) |T| {
291291 const eps = @sqrt(std.math.floatEps(T));
292292 try expectApproxEqRel(@as(T, @log(24.0)), lgamma(T, 5), eps);
......@@ -307,7 +307,7 @@ test "math.lgamma" {
307307 }
308308}
309309
310test "math.lgamma.special" {
310test "lgamma.special" {
311311 inline for (&.{ f32, f64 }) |T| {
312312 try expect(std.math.isNan(lgamma(T, -std.math.nan(T))));
313313 try expect(std.math.isNan(lgamma(T, std.math.nan(T))));
lib/std/math/hypot.zig+5-5
......@@ -124,7 +124,7 @@ fn hypot64(x: f64, y: f64) f64 {
124124 return z * @sqrt(ly + lx + hy + hx);
125125}
126126
127test "math.hypot" {
127test "hypot" {
128128 const x32: f32 = 0.0;
129129 const y32: f32 = -1.2;
130130 const x64: f64 = 0.0;
......@@ -133,7 +133,7 @@ test "math.hypot" {
133133 try expect(hypot(x64, y64) == hypot64(0.0, -1.2));
134134}
135135
136test "math.hypot32" {
136test "hypot32" {
137137 const epsilon = 0.000001;
138138
139139 try expect(math.approxEqAbs(f32, hypot32(0.0, -1.2), 1.2, epsilon));
......@@ -145,7 +145,7 @@ test "math.hypot32" {
145145 try expect(math.approxEqAbs(f32, hypot32(123123.234375, 529428.707813), 543556.875, epsilon));
146146}
147147
148test "math.hypot64" {
148test "hypot64" {
149149 const epsilon = 0.000001;
150150
151151 try expect(math.approxEqAbs(f64, hypot64(0.0, -1.2), 1.2, epsilon));
......@@ -157,7 +157,7 @@ test "math.hypot64" {
157157 try expect(math.approxEqAbs(f64, hypot64(123123.234375, 529428.707813), 543556.885247, epsilon));
158158}
159159
160test "math.hypot32.special" {
160test "hypot32.special" {
161161 try expect(math.isPositiveInf(hypot32(math.inf(f32), 0.0)));
162162 try expect(math.isPositiveInf(hypot32(-math.inf(f32), 0.0)));
163163 try expect(math.isPositiveInf(hypot32(0.0, math.inf(f32))));
......@@ -166,7 +166,7 @@ test "math.hypot32.special" {
166166 try expect(math.isNan(hypot32(0.0, math.nan(f32))));
167167}
168168
169test "math.hypot64.special" {
169test "hypot64.special" {
170170 try expect(math.isPositiveInf(hypot64(math.inf(f64), 0.0)));
171171 try expect(math.isPositiveInf(hypot64(-math.inf(f64), 0.0)));
172172 try expect(math.isPositiveInf(hypot64(0.0, math.inf(f64))));
lib/std/math/isfinite.zig+1-1
......@@ -10,7 +10,7 @@ pub fn isFinite(x: anytype) bool {
1010 return @as(TBits, @bitCast(x)) & remove_sign < @as(TBits, @bitCast(math.inf(T)));
1111}
1212
13test "math.isFinite" {
13test isFinite {
1414 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
1515 // normals
1616 try expect(isFinite(@as(T, 1.0)));
lib/std/math/isinf.zig+3-3
......@@ -20,7 +20,7 @@ pub inline fn isNegativeInf(x: anytype) bool {
2020 return x == -math.inf(@TypeOf(x));
2121}
2222
23test "math.isInf" {
23test isInf {
2424 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
2525 try expect(!isInf(@as(T, 0.0)));
2626 try expect(!isInf(@as(T, -0.0)));
......@@ -31,7 +31,7 @@ test "math.isInf" {
3131 }
3232}
3333
34test "math.isPositiveInf" {
34test isPositiveInf {
3535 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
3636 try expect(!isPositiveInf(@as(T, 0.0)));
3737 try expect(!isPositiveInf(@as(T, -0.0)));
......@@ -42,7 +42,7 @@ test "math.isPositiveInf" {
4242 }
4343}
4444
45test "math.isNegativeInf" {
45test isNegativeInf {
4646 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
4747 try expect(!isNegativeInf(@as(T, 0.0)));
4848 try expect(!isNegativeInf(@as(T, -0.0)));
lib/std/math/isnan.zig+2-2
......@@ -17,7 +17,7 @@ pub fn isSignalNan(x: anytype) bool {
1717 return isNan(x) and (@as(U, @bitCast(x)) & quiet_signal_bit_mask == 0);
1818}
1919
20test "math.isNan" {
20test isNan {
2121 inline for ([_]type{ f16, f32, f64, f80, f128, c_longdouble }) |T| {
2222 try expect(isNan(math.nan(T)));
2323 try expect(isNan(-math.nan(T)));
......@@ -27,7 +27,7 @@ test "math.isNan" {
2727 }
2828}
2929
30test "math.isSignalNan" {
30test isSignalNan {
3131 inline for ([_]type{ f16, f32, f64, f80, f128, c_longdouble }) |T| {
3232 // TODO: Signalling NaN values get converted to quiet NaN values in
3333 // some cases where they shouldn't such that this can fail.
lib/std/math/isnormal.zig+1-1
......@@ -19,7 +19,7 @@ pub fn isNormal(x: anytype) bool {
1919 return value & remove_sign >= (increment_exp << 1);
2020}
2121
22test "math.isNormal" {
22test isNormal {
2323 // TODO add `c_longdouble' when math.inf(T) supports it
2424 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
2525 const TBits = std.meta.Int(.unsigned, @bitSizeOf(T));
lib/std/math/ldexp.zig+1-1
......@@ -66,7 +66,7 @@ pub fn ldexp(x: anytype, n: i32) @TypeOf(x) {
6666 }
6767}
6868
69test "math.ldexp" {
69test ldexp {
7070 // subnormals
7171 try expect(ldexp(@as(f16, 0x1.1FFp14), -14 - 9 - 15) == math.floatTrueMin(f16));
7272 try expect(ldexp(@as(f32, 0x1.3FFFFFp-1), -126 - 22) == math.floatTrueMin(f32));
lib/std/math/log.zig+3-3
......@@ -47,7 +47,7 @@ pub fn log(comptime T: type, base: T, x: T) T {
4747 }
4848}
4949
50test "math.log integer" {
50test "log integer" {
5151 try expect(log(u8, 2, 0x1) == 0);
5252 try expect(log(u8, 2, 0x2) == 1);
5353 try expect(log(u16, 2, 0x72) == 6);
......@@ -55,7 +55,7 @@ test "math.log integer" {
5555 try expect(log(u64, 2, 0x7FF0123456789ABC) == 62);
5656}
5757
58test "math.log float" {
58test "log float" {
5959 const epsilon = 0.000001;
6060
6161 try expect(math.approxEqAbs(f32, log(f32, 6, 0.23947), -0.797723, epsilon));
......@@ -63,7 +63,7 @@ test "math.log float" {
6363 try expect(math.approxEqAbs(f64, log(f64, 123897, 12389216414), 1.981724596, epsilon));
6464}
6565
66test "math.log float_special" {
66test "log float_special" {
6767 try expect(log(f32, 2, 0.2301974) == math.log2(@as(f32, 0.2301974)));
6868 try expect(log(f32, 10, 0.2301974) == math.log10(@as(f32, 0.2301974)));
6969
lib/std/math/log1p.zig+5-5
......@@ -182,12 +182,12 @@ fn log1p_64(x: f64) f64 {
182182 return s * (hfsq + R) + (dk * ln2_lo + c) - hfsq + f + dk * ln2_hi;
183183}
184184
185test "math.log1p" {
185test "log1p" {
186186 try expect(log1p(@as(f32, 0.0)) == log1p_32(0.0));
187187 try expect(log1p(@as(f64, 0.0)) == log1p_64(0.0));
188188}
189189
190test "math.log1p_32" {
190test "log1p_32" {
191191 const epsilon = 0.000001;
192192
193193 try expect(math.approxEqAbs(f32, log1p_32(0.0), 0.0, epsilon));
......@@ -199,7 +199,7 @@ test "math.log1p_32" {
199199 try expect(math.approxEqAbs(f32, log1p_32(123123.234375), 11.720949, epsilon));
200200}
201201
202test "math.log1p_64" {
202test "log1p_64" {
203203 const epsilon = 0.000001;
204204
205205 try expect(math.approxEqAbs(f64, log1p_64(0.0), 0.0, epsilon));
......@@ -211,7 +211,7 @@ test "math.log1p_64" {
211211 try expect(math.approxEqAbs(f64, log1p_64(123123.234375), 11.720949, epsilon));
212212}
213213
214test "math.log1p_32.special" {
214test "log1p_32.special" {
215215 try expect(math.isPositiveInf(log1p_32(math.inf(f32))));
216216 try expect(math.isPositiveZero(log1p_32(0.0)));
217217 try expect(math.isNegativeZero(log1p_32(-0.0)));
......@@ -220,7 +220,7 @@ test "math.log1p_32.special" {
220220 try expect(math.isNan(log1p_32(math.nan(f32))));
221221}
222222
223test "math.log1p_64.special" {
223test "log1p_64.special" {
224224 try expect(math.isPositiveInf(log1p_64(math.inf(f64))));
225225 try expect(math.isPositiveZero(log1p_64(0.0)));
226226 try expect(math.isNegativeZero(log1p_64(-0.0)));
lib/std/math/log_int.zig+4-4
......@@ -60,7 +60,7 @@ pub fn log_int(comptime T: type, base: T, x: T) Log2Int(T) {
6060 return exponent;
6161}
6262
63test "math.log_int" {
63test "log_int" {
6464 // Test all unsigned integers with 2, 3, ..., 64 bits.
6565 // We cannot test 0 or 1 bits since base must be > 1.
6666 inline for (2..64 + 1) |bits| {
......@@ -92,7 +92,7 @@ test "math.log_int" {
9292 }
9393}
9494
95test "math.log_int vs math.log2" {
95test "log_int vs math.log2" {
9696 const types = [_]type{ u2, u3, u4, u8, u16 };
9797 inline for (types) |T| {
9898 var n: T = 0;
......@@ -105,7 +105,7 @@ test "math.log_int vs math.log2" {
105105 }
106106}
107107
108test "math.log_int vs math.log10" {
108test "log_int vs math.log10" {
109109 const types = [_]type{ u4, u5, u6, u8, u16 };
110110 inline for (types) |T| {
111111 var n: T = 0;
......@@ -118,7 +118,7 @@ test "math.log_int vs math.log10" {
118118 }
119119}
120120
121test "math.log_int at comptime" {
121test "log_int at comptime" {
122122 const x = 59049; // 9 ** 5;
123123 comptime {
124124 if (math.log_int(comptime_int, 9, x) != 5) {
lib/std/math/modf.zig+5-5
......@@ -123,14 +123,14 @@ fn modf64(x: f64) modf64_result {
123123 return result;
124124}
125125
126test "math.modf" {
126test "modf" {
127127 const a = modf(@as(f32, 1.0));
128128 const b = modf32(1.0);
129129 // NOTE: No struct comparison on generic return type function? non-named, makes sense, but still.
130130 try expectEqual(a, b);
131131}
132132
133test "math.modf32" {
133test "modf32" {
134134 const epsilon = 0.000001;
135135 var r: modf32_result = undefined;
136136
......@@ -155,7 +155,7 @@ test "math.modf32" {
155155 try expect(math.approxEqAbs(f32, r.fpart, 0.340820, epsilon));
156156}
157157
158test "math.modf64" {
158test "modf64" {
159159 const epsilon = 0.000001;
160160 var r: modf64_result = undefined;
161161
......@@ -180,7 +180,7 @@ test "math.modf64" {
180180 try expect(math.approxEqAbs(f64, r.fpart, 0.340780, epsilon));
181181}
182182
183test "math.modf32.special" {
183test "modf32.special" {
184184 var r: modf32_result = undefined;
185185
186186 r = modf32(math.inf(f32));
......@@ -193,7 +193,7 @@ test "math.modf32.special" {
193193 try expect(math.isNan(r.ipart) and math.isNan(r.fpart));
194194}
195195
196test "math.modf64.special" {
196test "modf64.special" {
197197 var r: modf64_result = undefined;
198198
199199 r = modf64(math.inf(f64));
lib/std/math/nextafter.zig+2-2
......@@ -101,7 +101,7 @@ fn nextAfterFloat(comptime T: type, x: T, y: T) T {
101101 }
102102}
103103
104test "math.nextAfter.int" {
104test "int" {
105105 try expect(nextAfter(i0, 0, 0) == 0);
106106 try expect(nextAfter(u0, 0, 0) == 0);
107107 try expect(nextAfter(i1, 0, 0) == 0);
......@@ -143,7 +143,7 @@ test "math.nextAfter.int" {
143143 }
144144}
145145
146test "math.nextAfter.float" {
146test "float" {
147147 @setEvalBranchQuota(2000);
148148
149149 // normal -> normal
lib/std/math/pow.zig+4-4
......@@ -190,7 +190,7 @@ fn isOddInteger(x: f64) bool {
190190 return r.fpart == 0.0 and @as(i64, @intFromFloat(r.ipart)) & 1 == 1;
191191}
192192
193test "math.pow.isOddInteger" {
193test isOddInteger {
194194 try expect(isOddInteger(math.maxInt(i64) * 2) == false);
195195 try expect(isOddInteger(math.maxInt(i64) * 2 + 1) == false);
196196 try expect(isOddInteger(1 << 53) == false);
......@@ -198,7 +198,7 @@ test "math.pow.isOddInteger" {
198198 try expect(isOddInteger(15.0) == true);
199199}
200200
201test "math.pow" {
201test pow {
202202 const epsilon = 0.000001;
203203
204204 try expect(math.approxEqAbs(f32, pow(f32, 0.0, 3.3), 0.0, epsilon));
......@@ -216,7 +216,7 @@ test "math.pow" {
216216 try expect(math.approxEqAbs(f64, pow(f64, 89.123, 3.3), 2722490.231436, epsilon));
217217}
218218
219test "math.pow.special" {
219test "special" {
220220 const epsilon = 0.000001;
221221
222222 try expect(pow(f32, 4, 0.0) == 1.0);
......@@ -258,7 +258,7 @@ test "math.pow.special" {
258258 try expect(math.isNan(pow(f32, -12.4, 78.5)));
259259}
260260
261test "math.pow.overflow" {
261test "overflow" {
262262 try expect(math.isPositiveInf(pow(f64, 2, 1 << 32)));
263263 try expect(pow(f64, 2, -(1 << 32)) == 0);
264264 try expect(math.isNegativeInf(pow(f64, -2, (1 << 32) + 1)));
lib/std/math/powi.zig+3-3
......@@ -91,7 +91,7 @@ pub fn powi(comptime T: type, x: T, y: T) (error{
9191 return acc;
9292}
9393
94test "math.powi" {
94test "powi" {
9595 try testing.expectError(error.Overflow, powi(i8, -66, 6));
9696 try testing.expectError(error.Overflow, powi(i16, -13, 13));
9797 try testing.expectError(error.Overflow, powi(i32, -32, 21));
......@@ -141,7 +141,7 @@ test "math.powi" {
141141 try testing.expectError(error.Underflow, powi(i42, 34, -6));
142142}
143143
144test "math.powi.special" {
144test "powi.special" {
145145 try testing.expectError(error.Overflow, powi(i8, -2, 8));
146146 try testing.expectError(error.Overflow, powi(i16, -2, 16));
147147 try testing.expectError(error.Overflow, powi(i32, -2, 32));
......@@ -186,7 +186,7 @@ test "math.powi.special" {
186186 try testing.expect((try powi(u42, 34, 0)) == 1);
187187}
188188
189test "math.powi.narrow" {
189test "powi.narrow" {
190190 try testing.expectError(error.Overflow, powi(u0, 0, 0));
191191 try testing.expectError(error.Overflow, powi(i0, 0, 0));
192192 try testing.expectError(error.Overflow, powi(i1, 0, 0));
lib/std/math/scalbn.zig+1-1
......@@ -6,7 +6,7 @@ const expect = std.testing.expect;
66/// Zig only supports binary base IEEE-754 floats. Hence FLT_RADIX=2, and this is an alias for ldexp.
77pub const scalbn = @import("ldexp.zig").ldexp;
88
9test "math.scalbn" {
9test scalbn {
1010 // Verify we are using base 2.
1111 try expect(scalbn(@as(f16, 1.5), 4) == 24.0);
1212 try expect(scalbn(@as(f32, 1.5), 4) == 24.0);
lib/std/math/signbit.zig+1-1
......@@ -9,7 +9,7 @@ pub fn signbit(x: anytype) bool {
99 return @as(TBits, @bitCast(x)) >> (@bitSizeOf(T) - 1) != 0;
1010}
1111
12test "math.signbit" {
12test signbit {
1313 inline for ([_]type{ f16, f32, f64, f80, f128 }) |T| {
1414 try expect(!signbit(@as(T, 0.0)));
1515 try expect(!signbit(@as(T, 1.0)));
lib/std/math/sinh.zig+5-5
......@@ -91,12 +91,12 @@ fn sinh64(x: f64) f64 {
9191 return 2 * h * expo2(ax);
9292}
9393
94test "math.sinh" {
94test "sinh" {
9595 try expect(sinh(@as(f32, 1.5)) == sinh32(1.5));
9696 try expect(sinh(@as(f64, 1.5)) == sinh64(1.5));
9797}
9898
99test "math.sinh32" {
99test "sinh32" {
100100 const epsilon = 0.000001;
101101
102102 try expect(math.approxEqAbs(f32, sinh32(0.0), 0.0, epsilon));
......@@ -109,7 +109,7 @@ test "math.sinh32" {
109109 try expect(math.approxEqAbs(f32, sinh32(-1.5), -2.129279, epsilon));
110110}
111111
112test "math.sinh64" {
112test "sinh64" {
113113 const epsilon = 0.000001;
114114
115115 try expect(math.approxEqAbs(f64, sinh64(0.0), 0.0, epsilon));
......@@ -122,7 +122,7 @@ test "math.sinh64" {
122122 try expect(math.approxEqAbs(f64, sinh64(-1.5), -2.129279, epsilon));
123123}
124124
125test "math.sinh32.special" {
125test "sinh32.special" {
126126 try expect(math.isPositiveZero(sinh32(0.0)));
127127 try expect(math.isNegativeZero(sinh32(-0.0)));
128128 try expect(math.isPositiveInf(sinh32(math.inf(f32))));
......@@ -130,7 +130,7 @@ test "math.sinh32.special" {
130130 try expect(math.isNan(sinh32(math.nan(f32))));
131131}
132132
133test "math.sinh64.special" {
133test "sinh64.special" {
134134 try expect(math.isPositiveZero(sinh64(0.0)));
135135 try expect(math.isNegativeZero(sinh64(-0.0)));
136136 try expect(math.isPositiveInf(sinh64(math.inf(f64))));
lib/std/math/sqrt.zig+1-1
......@@ -61,7 +61,7 @@ fn sqrt_int(comptime T: type, value: T) Sqrt(T) {
6161 }
6262}
6363
64test "math.sqrt_int" {
64test sqrt_int {
6565 try expect(sqrt_int(u32, 3) == 1);
6666 try expect(sqrt_int(u32, 4) == 2);
6767 try expect(sqrt_int(u32, 5) == 2);
lib/std/math/tanh.zig+5-5
......@@ -104,12 +104,12 @@ fn tanh64(x: f64) f64 {
104104 return if (sign) -t else t;
105105}
106106
107test "math.tanh" {
107test "tanh" {
108108 try expect(tanh(@as(f32, 1.5)) == tanh32(1.5));
109109 try expect(tanh(@as(f64, 1.5)) == tanh64(1.5));
110110}
111111
112test "math.tanh32" {
112test "tanh32" {
113113 const epsilon = 0.000001;
114114
115115 try expect(math.approxEqAbs(f32, tanh32(0.0), 0.0, epsilon));
......@@ -122,7 +122,7 @@ test "math.tanh32" {
122122 try expect(math.approxEqAbs(f32, tanh32(-37.45), -1.0, epsilon));
123123}
124124
125test "math.tanh64" {
125test "tanh64" {
126126 const epsilon = 0.000001;
127127
128128 try expect(math.approxEqAbs(f64, tanh64(0.0), 0.0, epsilon));
......@@ -135,7 +135,7 @@ test "math.tanh64" {
135135 try expect(math.approxEqAbs(f64, tanh64(-37.45), -1.0, epsilon));
136136}
137137
138test "math.tanh32.special" {
138test "tanh32.special" {
139139 try expect(math.isPositiveZero(tanh32(0.0)));
140140 try expect(math.isNegativeZero(tanh32(-0.0)));
141141 try expect(tanh32(math.inf(f32)) == 1.0);
......@@ -143,7 +143,7 @@ test "math.tanh32.special" {
143143 try expect(math.isNan(tanh32(math.nan(f32))));
144144}
145145
146test "math.tanh64.special" {
146test "tanh64.special" {
147147 try expect(math.isPositiveZero(tanh64(0.0)));
148148 try expect(math.isNegativeZero(tanh64(-0.0)));
149149 try expect(tanh64(math.inf(f64)) == 1.0);
lib/std/meta.zig+19-19
......@@ -46,7 +46,7 @@ pub fn stringToEnum(comptime T: type, str: []const u8) ?T {
4646 }
4747}
4848
49test "std.meta.stringToEnum" {
49test "stringToEnum" {
5050 const E1 = enum {
5151 A,
5252 B,
......@@ -73,7 +73,7 @@ pub fn alignment(comptime T: type) comptime_int {
7373 };
7474}
7575
76test "std.meta.alignment" {
76test "alignment" {
7777 try testing.expect(alignment(u8) == 1);
7878 try testing.expect(alignment(*align(1) u8) == 1);
7979 try testing.expect(alignment(*align(2) u8) == 2);
......@@ -94,7 +94,7 @@ pub fn Child(comptime T: type) type {
9494 };
9595}
9696
97test "std.meta.Child" {
97test "Child" {
9898 try testing.expect(Child([1]u8) == u8);
9999 try testing.expect(Child(*u8) == u8);
100100 try testing.expect(Child([]u8) == u8);
......@@ -121,7 +121,7 @@ pub fn Elem(comptime T: type) type {
121121 @compileError("Expected pointer, slice, array or vector type, found '" ++ @typeName(T) ++ "'");
122122}
123123
124test "std.meta.Elem" {
124test "Elem" {
125125 try testing.expect(Elem([1]u8) == u8);
126126 try testing.expect(Elem([*]u8) == u8);
127127 try testing.expect(Elem([]u8) == u8);
......@@ -255,7 +255,7 @@ pub fn containerLayout(comptime T: type) Type.ContainerLayout {
255255 };
256256}
257257
258test "std.meta.containerLayout" {
258test "containerLayout" {
259259 const S1 = struct {};
260260 const S2 = packed struct {};
261261 const S3 = extern struct {};
......@@ -289,7 +289,7 @@ pub fn declarations(comptime T: type) []const Type.Declaration {
289289 };
290290}
291291
292test "std.meta.declarations" {
292test "declarations" {
293293 const E1 = enum {
294294 A,
295295
......@@ -329,7 +329,7 @@ pub fn declarationInfo(comptime T: type, comptime decl_name: []const u8) Type.De
329329 @compileError("'" ++ @typeName(T) ++ "' has no declaration '" ++ decl_name ++ "'");
330330}
331331
332test "std.meta.declarationInfo" {
332test "declarationInfo" {
333333 const E1 = enum {
334334 A,
335335
......@@ -370,7 +370,7 @@ pub fn fields(comptime T: type) switch (@typeInfo(T)) {
370370 };
371371}
372372
373test "std.meta.fields" {
373test "fields" {
374374 const E1 = enum {
375375 A,
376376 };
......@@ -409,7 +409,7 @@ pub fn fieldInfo(comptime T: type, comptime field: FieldEnum(T)) switch (@typeIn
409409 return fields(T)[@intFromEnum(field)];
410410}
411411
412test "std.meta.fieldInfo" {
412test "fieldInfo" {
413413 const E1 = enum {
414414 A,
415415 };
......@@ -442,7 +442,7 @@ pub fn FieldType(comptime T: type, comptime field: FieldEnum(T)) type {
442442 return fieldInfo(T, field).type;
443443}
444444
445test "std.meta.FieldType" {
445test "FieldType" {
446446 const S = struct {
447447 a: u8,
448448 b: u16,
......@@ -470,7 +470,7 @@ pub fn fieldNames(comptime T: type) *const [fields(T).len][:0]const u8 {
470470 };
471471}
472472
473test "std.meta.fieldNames" {
473test "fieldNames" {
474474 const E1 = enum { A, B };
475475 const E2 = error{A};
476476 const S1 = struct {
......@@ -511,7 +511,7 @@ pub fn tags(comptime T: type) *const [fields(T).len]T {
511511 };
512512}
513513
514test "std.meta.tags" {
514test "tags" {
515515 const E1 = enum { A, B };
516516 const E2 = error{A};
517517
......@@ -604,7 +604,7 @@ fn expectEqualEnum(expected: anytype, actual: @TypeOf(expected)) !void {
604604 );
605605}
606606
607test "std.meta.FieldEnum" {
607test "FieldEnum" {
608608 try expectEqualEnum(enum {}, FieldEnum(struct {}));
609609 try expectEqualEnum(enum { a }, FieldEnum(struct { a: u8 }));
610610 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 {
639639 });
640640}
641641
642test "std.meta.DeclEnum" {
642test "DeclEnum" {
643643 const A = struct {
644644 pub const a: u8 = 0;
645645 };
......@@ -670,7 +670,7 @@ pub fn Tag(comptime T: type) type {
670670 };
671671}
672672
673test "std.meta.Tag" {
673test "Tag" {
674674 const E = enum(u8) {
675675 C = 33,
676676 D,
......@@ -690,7 +690,7 @@ pub fn activeTag(u: anytype) Tag(@TypeOf(u)) {
690690 return @as(Tag(T), u);
691691}
692692
693test "std.meta.activeTag" {
693test "activeTag" {
694694 const UE = enum {
695695 Int,
696696 Float,
......@@ -727,7 +727,7 @@ pub fn TagPayload(comptime U: type, comptime tag: Tag(U)) type {
727727 return TagPayloadByName(U, @tagName(tag));
728728}
729729
730test "std.meta.TagPayload" {
730test "TagPayload" {
731731 const Event = union(enum) {
732732 Moved: struct {
733733 from: i32,
......@@ -802,7 +802,7 @@ pub fn eql(a: anytype, b: @TypeOf(a)) bool {
802802 }
803803}
804804
805test "std.meta.eql" {
805test "eql" {
806806 const S = struct {
807807 a: u32,
808808 b: f64,
......@@ -965,7 +965,7 @@ pub fn Float(comptime bit_count: u8) type {
965965 });
966966}
967967
968test "std.meta.Float" {
968test "Float" {
969969 try testing.expectEqual(f16, Float(16));
970970 try testing.expectEqual(f32, Float(32));
971971 try testing.expectEqual(f64, Float(64));
lib/std/os/test.zig+1-1
......@@ -393,7 +393,7 @@ fn testThreadIdFn(thread_id: *Thread.Id) void {
393393 thread_id.* = Thread.getCurrentId();
394394}
395395
396test "std.Thread.getCurrentId" {
396test "Thread.getCurrentId" {
397397 if (builtin.single_threaded) return error.SkipZigTest;
398398
399399 var thread_current_id: Thread.Id = undefined;
lib/std/priority_dequeue.zig+31-31
......@@ -467,7 +467,7 @@ fn lessThanComparison(context: void, a: u32, b: u32) Order {
467467
468468const PDQ = PriorityDequeue(u32, void, lessThanComparison);
469469
470test "std.PriorityDequeue: add and remove min" {
470test "add and remove min" {
471471 var queue = PDQ.init(testing.allocator, {});
472472 defer queue.deinit();
473473
......@@ -486,7 +486,7 @@ test "std.PriorityDequeue: add and remove min" {
486486 try expectEqual(@as(u32, 54), queue.removeMin());
487487}
488488
489test "std.PriorityDequeue: add and remove min structs" {
489test "add and remove min structs" {
490490 const S = struct {
491491 size: u32,
492492 };
......@@ -513,7 +513,7 @@ test "std.PriorityDequeue: add and remove min structs" {
513513 try expectEqual(@as(u32, 54), queue.removeMin().size);
514514}
515515
516test "std.PriorityDequeue: add and remove max" {
516test "add and remove max" {
517517 var queue = PDQ.init(testing.allocator, {});
518518 defer queue.deinit();
519519
......@@ -532,7 +532,7 @@ test "std.PriorityDequeue: add and remove max" {
532532 try expectEqual(@as(u32, 7), queue.removeMax());
533533}
534534
535test "std.PriorityDequeue: add and remove same min" {
535test "add and remove same min" {
536536 var queue = PDQ.init(testing.allocator, {});
537537 defer queue.deinit();
538538
......@@ -551,7 +551,7 @@ test "std.PriorityDequeue: add and remove same min" {
551551 try expectEqual(@as(u32, 2), queue.removeMin());
552552}
553553
554test "std.PriorityDequeue: add and remove same max" {
554test "add and remove same max" {
555555 var queue = PDQ.init(testing.allocator, {});
556556 defer queue.deinit();
557557
......@@ -570,7 +570,7 @@ test "std.PriorityDequeue: add and remove same max" {
570570 try expectEqual(@as(u32, 1), queue.removeMax());
571571}
572572
573test "std.PriorityDequeue: removeOrNull empty" {
573test "removeOrNull empty" {
574574 var queue = PDQ.init(testing.allocator, {});
575575 defer queue.deinit();
576576
......@@ -578,7 +578,7 @@ test "std.PriorityDequeue: removeOrNull empty" {
578578 try expect(queue.removeMaxOrNull() == null);
579579}
580580
581test "std.PriorityDequeue: edge case 3 elements" {
581test "edge case 3 elements" {
582582 var queue = PDQ.init(testing.allocator, {});
583583 defer queue.deinit();
584584
......@@ -591,7 +591,7 @@ test "std.PriorityDequeue: edge case 3 elements" {
591591 try expectEqual(@as(u32, 9), queue.removeMin());
592592}
593593
594test "std.PriorityDequeue: edge case 3 elements max" {
594test "edge case 3 elements max" {
595595 var queue = PDQ.init(testing.allocator, {});
596596 defer queue.deinit();
597597
......@@ -604,7 +604,7 @@ test "std.PriorityDequeue: edge case 3 elements max" {
604604 try expectEqual(@as(u32, 2), queue.removeMax());
605605}
606606
607test "std.PriorityDequeue: peekMin" {
607test "peekMin" {
608608 var queue = PDQ.init(testing.allocator, {});
609609 defer queue.deinit();
610610
......@@ -618,7 +618,7 @@ test "std.PriorityDequeue: peekMin" {
618618 try expect(queue.peekMin().? == 2);
619619}
620620
621test "std.PriorityDequeue: peekMax" {
621test "peekMax" {
622622 var queue = PDQ.init(testing.allocator, {});
623623 defer queue.deinit();
624624
......@@ -632,7 +632,7 @@ test "std.PriorityDequeue: peekMax" {
632632 try expect(queue.peekMax().? == 9);
633633}
634634
635test "std.PriorityDequeue: sift up with odd indices, removeMin" {
635test "sift up with odd indices, removeMin" {
636636 var queue = PDQ.init(testing.allocator, {});
637637 defer queue.deinit();
638638 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -646,7 +646,7 @@ test "std.PriorityDequeue: sift up with odd indices, removeMin" {
646646 }
647647}
648648
649test "std.PriorityDequeue: sift up with odd indices, removeMax" {
649test "sift up with odd indices, removeMax" {
650650 var queue = PDQ.init(testing.allocator, {});
651651 defer queue.deinit();
652652 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -660,7 +660,7 @@ test "std.PriorityDequeue: sift up with odd indices, removeMax" {
660660 }
661661}
662662
663test "std.PriorityDequeue: addSlice min" {
663test "addSlice min" {
664664 var queue = PDQ.init(testing.allocator, {});
665665 defer queue.deinit();
666666 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -672,7 +672,7 @@ test "std.PriorityDequeue: addSlice min" {
672672 }
673673}
674674
675test "std.PriorityDequeue: addSlice max" {
675test "addSlice max" {
676676 var queue = PDQ.init(testing.allocator, {});
677677 defer queue.deinit();
678678 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -684,7 +684,7 @@ test "std.PriorityDequeue: addSlice max" {
684684 }
685685}
686686
687test "std.PriorityDequeue: fromOwnedSlice trivial case 0" {
687test "fromOwnedSlice trivial case 0" {
688688 const items = [0]u32{};
689689 const queue_items = try testing.allocator.dupe(u32, &items);
690690 var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {});
......@@ -693,7 +693,7 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 0" {
693693 try expect(queue.removeMinOrNull() == null);
694694}
695695
696test "std.PriorityDequeue: fromOwnedSlice trivial case 1" {
696test "fromOwnedSlice trivial case 1" {
697697 const items = [1]u32{1};
698698 const queue_items = try testing.allocator.dupe(u32, &items);
699699 var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {});
......@@ -704,7 +704,7 @@ test "std.PriorityDequeue: fromOwnedSlice trivial case 1" {
704704 try expect(queue.removeMinOrNull() == null);
705705}
706706
707test "std.PriorityDequeue: fromOwnedSlice" {
707test "fromOwnedSlice" {
708708 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
709709 const queue_items = try testing.allocator.dupe(u32, items[0..]);
710710 var queue = PDQ.fromOwnedSlice(testing.allocator, queue_items[0..], {});
......@@ -716,7 +716,7 @@ test "std.PriorityDequeue: fromOwnedSlice" {
716716 }
717717}
718718
719test "std.PriorityDequeue: update min queue" {
719test "update min queue" {
720720 var queue = PDQ.init(testing.allocator, {});
721721 defer queue.deinit();
722722
......@@ -731,7 +731,7 @@ test "std.PriorityDequeue: update min queue" {
731731 try expectEqual(@as(u32, 5), queue.removeMin());
732732}
733733
734test "std.PriorityDequeue: update same min queue" {
734test "update same min queue" {
735735 var queue = PDQ.init(testing.allocator, {});
736736 defer queue.deinit();
737737
......@@ -747,7 +747,7 @@ test "std.PriorityDequeue: update same min queue" {
747747 try expectEqual(@as(u32, 5), queue.removeMin());
748748}
749749
750test "std.PriorityDequeue: update max queue" {
750test "update max queue" {
751751 var queue = PDQ.init(testing.allocator, {});
752752 defer queue.deinit();
753753
......@@ -763,7 +763,7 @@ test "std.PriorityDequeue: update max queue" {
763763 try expectEqual(@as(u32, 1), queue.removeMax());
764764}
765765
766test "std.PriorityDequeue: update same max queue" {
766test "update same max queue" {
767767 var queue = PDQ.init(testing.allocator, {});
768768 defer queue.deinit();
769769
......@@ -779,7 +779,7 @@ test "std.PriorityDequeue: update same max queue" {
779779 try expectEqual(@as(u32, 1), queue.removeMax());
780780}
781781
782test "std.PriorityDequeue: update after remove" {
782test "update after remove" {
783783 var queue = PDQ.init(testing.allocator, {});
784784 defer queue.deinit();
785785
......@@ -788,7 +788,7 @@ test "std.PriorityDequeue: update after remove" {
788788 try expectError(error.ElementNotFound, queue.update(1, 1));
789789}
790790
791test "std.PriorityDequeue: iterator" {
791test "iterator" {
792792 var queue = PDQ.init(testing.allocator, {});
793793 var map = std.AutoHashMap(u32, void).init(testing.allocator);
794794 defer {
......@@ -810,7 +810,7 @@ test "std.PriorityDequeue: iterator" {
810810 try expectEqual(@as(usize, 0), map.count());
811811}
812812
813test "std.PriorityDequeue: remove at index" {
813test "remove at index" {
814814 var queue = PDQ.init(testing.allocator, {});
815815 defer queue.deinit();
816816
......@@ -833,7 +833,7 @@ test "std.PriorityDequeue: remove at index" {
833833 try expectEqual(queue.removeMinOrNull(), null);
834834}
835835
836test "std.PriorityDequeue: iterator while empty" {
836test "iterator while empty" {
837837 var queue = PDQ.init(testing.allocator, {});
838838 defer queue.deinit();
839839
......@@ -842,7 +842,7 @@ test "std.PriorityDequeue: iterator while empty" {
842842 try expectEqual(it.next(), null);
843843}
844844
845test "std.PriorityDequeue: shrinkAndFree" {
845test "shrinkAndFree" {
846846 var queue = PDQ.init(testing.allocator, {});
847847 defer queue.deinit();
848848
......@@ -865,7 +865,7 @@ test "std.PriorityDequeue: shrinkAndFree" {
865865 try expect(queue.removeMaxOrNull() == null);
866866}
867867
868test "std.PriorityDequeue: fuzz testing min" {
868test "fuzz testing min" {
869869 var prng = std.Random.DefaultPrng.init(0x12345678);
870870 const random = prng.random();
871871
......@@ -894,7 +894,7 @@ fn fuzzTestMin(rng: std.Random, comptime queue_size: usize) !void {
894894 }
895895}
896896
897test "std.PriorityDequeue: fuzz testing max" {
897test "fuzz testing max" {
898898 var prng = std.Random.DefaultPrng.init(0x87654321);
899899 const random = prng.random();
900900
......@@ -923,7 +923,7 @@ fn fuzzTestMax(rng: std.Random, queue_size: usize) !void {
923923 }
924924}
925925
926test "std.PriorityDequeue: fuzz testing min and max" {
926test "fuzz testing min and max" {
927927 var prng = std.Random.DefaultPrng.init(0x87654321);
928928 const random = prng.random();
929929
......@@ -982,7 +982,7 @@ fn contextLessThanComparison(context: []const u32, a: usize, b: usize) Order {
982982
983983const CPDQ = PriorityDequeue(usize, []const u32, contextLessThanComparison);
984984
985test "std.PriorityDequeue: add and remove" {
985test "add and remove" {
986986 const context = [_]u32{ 5, 3, 4, 2, 2, 8, 0 };
987987
988988 var queue = CPDQ.init(testing.allocator, context[0..]);
......@@ -1006,7 +1006,7 @@ test "std.PriorityDequeue: add and remove" {
10061006
10071007var all_cmps_unique = true;
10081008
1009test "std.PriorityDeque: don't compare a value to a copy of itself" {
1009test "don't compare a value to a copy of itself" {
10101010 var depq = PriorityDequeue(u32, void, struct {
10111011 fn uniqueLessThan(_: void, a: u32, b: u32) Order {
10121012 all_cmps_unique = all_cmps_unique and (a != b);
lib/std/priority_queue.zig+23-23
......@@ -271,7 +271,7 @@ fn greaterThan(context: void, a: u32, b: u32) Order {
271271const PQlt = PriorityQueue(u32, void, lessThan);
272272const PQgt = PriorityQueue(u32, void, greaterThan);
273273
274test "std.PriorityQueue: add and remove min heap" {
274test "add and remove min heap" {
275275 var queue = PQlt.init(testing.allocator, {});
276276 defer queue.deinit();
277277
......@@ -289,7 +289,7 @@ test "std.PriorityQueue: add and remove min heap" {
289289 try expectEqual(@as(u32, 54), queue.remove());
290290}
291291
292test "std.PriorityQueue: add and remove same min heap" {
292test "add and remove same min heap" {
293293 var queue = PQlt.init(testing.allocator, {});
294294 defer queue.deinit();
295295
......@@ -307,14 +307,14 @@ test "std.PriorityQueue: add and remove same min heap" {
307307 try expectEqual(@as(u32, 2), queue.remove());
308308}
309309
310test "std.PriorityQueue: removeOrNull on empty" {
310test "removeOrNull on empty" {
311311 var queue = PQlt.init(testing.allocator, {});
312312 defer queue.deinit();
313313
314314 try expect(queue.removeOrNull() == null);
315315}
316316
317test "std.PriorityQueue: edge case 3 elements" {
317test "edge case 3 elements" {
318318 var queue = PQlt.init(testing.allocator, {});
319319 defer queue.deinit();
320320
......@@ -326,7 +326,7 @@ test "std.PriorityQueue: edge case 3 elements" {
326326 try expectEqual(@as(u32, 9), queue.remove());
327327}
328328
329test "std.PriorityQueue: peek" {
329test "peek" {
330330 var queue = PQlt.init(testing.allocator, {});
331331 defer queue.deinit();
332332
......@@ -338,7 +338,7 @@ test "std.PriorityQueue: peek" {
338338 try expectEqual(@as(u32, 2), queue.peek().?);
339339}
340340
341test "std.PriorityQueue: sift up with odd indices" {
341test "sift up with odd indices" {
342342 var queue = PQlt.init(testing.allocator, {});
343343 defer queue.deinit();
344344 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -352,7 +352,7 @@ test "std.PriorityQueue: sift up with odd indices" {
352352 }
353353}
354354
355test "std.PriorityQueue: addSlice" {
355test "addSlice" {
356356 var queue = PQlt.init(testing.allocator, {});
357357 defer queue.deinit();
358358 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
......@@ -364,7 +364,7 @@ test "std.PriorityQueue: addSlice" {
364364 }
365365}
366366
367test "std.PriorityQueue: fromOwnedSlice trivial case 0" {
367test "fromOwnedSlice trivial case 0" {
368368 const items = [0]u32{};
369369 const queue_items = try testing.allocator.dupe(u32, &items);
370370 var queue = PQlt.fromOwnedSlice(testing.allocator, queue_items[0..], {});
......@@ -373,7 +373,7 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 0" {
373373 try expect(queue.removeOrNull() == null);
374374}
375375
376test "std.PriorityQueue: fromOwnedSlice trivial case 1" {
376test "fromOwnedSlice trivial case 1" {
377377 const items = [1]u32{1};
378378 const queue_items = try testing.allocator.dupe(u32, &items);
379379 var queue = PQlt.fromOwnedSlice(testing.allocator, queue_items[0..], {});
......@@ -384,7 +384,7 @@ test "std.PriorityQueue: fromOwnedSlice trivial case 1" {
384384 try expect(queue.removeOrNull() == null);
385385}
386386
387test "std.PriorityQueue: fromOwnedSlice" {
387test "fromOwnedSlice" {
388388 const items = [_]u32{ 15, 7, 21, 14, 13, 22, 12, 6, 7, 25, 5, 24, 11, 16, 15, 24, 2, 1 };
389389 const heap_items = try testing.allocator.dupe(u32, items[0..]);
390390 var queue = PQlt.fromOwnedSlice(testing.allocator, heap_items[0..], {});
......@@ -396,7 +396,7 @@ test "std.PriorityQueue: fromOwnedSlice" {
396396 }
397397}
398398
399test "std.PriorityQueue: add and remove max heap" {
399test "add and remove max heap" {
400400 var queue = PQgt.init(testing.allocator, {});
401401 defer queue.deinit();
402402
......@@ -414,7 +414,7 @@ test "std.PriorityQueue: add and remove max heap" {
414414 try expectEqual(@as(u32, 7), queue.remove());
415415}
416416
417test "std.PriorityQueue: add and remove same max heap" {
417test "add and remove same max heap" {
418418 var queue = PQgt.init(testing.allocator, {});
419419 defer queue.deinit();
420420
......@@ -432,7 +432,7 @@ test "std.PriorityQueue: add and remove same max heap" {
432432 try expectEqual(@as(u32, 1), queue.remove());
433433}
434434
435test "std.PriorityQueue: iterator" {
435test "iterator" {
436436 var queue = PQlt.init(testing.allocator, {});
437437 var map = std.AutoHashMap(u32, void).init(testing.allocator);
438438 defer {
......@@ -454,7 +454,7 @@ test "std.PriorityQueue: iterator" {
454454 try expectEqual(@as(usize, 0), map.count());
455455}
456456
457test "std.PriorityQueue: remove at index" {
457test "remove at index" {
458458 var queue = PQlt.init(testing.allocator, {});
459459 defer queue.deinit();
460460
......@@ -480,7 +480,7 @@ test "std.PriorityQueue: remove at index" {
480480 try expectEqual(queue.removeOrNull(), null);
481481}
482482
483test "std.PriorityQueue: iterator while empty" {
483test "iterator while empty" {
484484 var queue = PQlt.init(testing.allocator, {});
485485 defer queue.deinit();
486486
......@@ -489,7 +489,7 @@ test "std.PriorityQueue: iterator while empty" {
489489 try expectEqual(it.next(), null);
490490}
491491
492test "std.PriorityQueue: shrinkAndFree" {
492test "shrinkAndFree" {
493493 var queue = PQlt.init(testing.allocator, {});
494494 defer queue.deinit();
495495
......@@ -512,7 +512,7 @@ test "std.PriorityQueue: shrinkAndFree" {
512512 try expect(queue.removeOrNull() == null);
513513}
514514
515test "std.PriorityQueue: update min heap" {
515test "update min heap" {
516516 var queue = PQlt.init(testing.allocator, {});
517517 defer queue.deinit();
518518
......@@ -527,7 +527,7 @@ test "std.PriorityQueue: update min heap" {
527527 try expectEqual(@as(u32, 5), queue.remove());
528528}
529529
530test "std.PriorityQueue: update same min heap" {
530test "update same min heap" {
531531 var queue = PQlt.init(testing.allocator, {});
532532 defer queue.deinit();
533533
......@@ -543,7 +543,7 @@ test "std.PriorityQueue: update same min heap" {
543543 try expectEqual(@as(u32, 5), queue.remove());
544544}
545545
546test "std.PriorityQueue: update max heap" {
546test "update max heap" {
547547 var queue = PQgt.init(testing.allocator, {});
548548 defer queue.deinit();
549549
......@@ -558,7 +558,7 @@ test "std.PriorityQueue: update max heap" {
558558 try expectEqual(@as(u32, 1), queue.remove());
559559}
560560
561test "std.PriorityQueue: update same max heap" {
561test "update same max heap" {
562562 var queue = PQgt.init(testing.allocator, {});
563563 defer queue.deinit();
564564
......@@ -574,7 +574,7 @@ test "std.PriorityQueue: update same max heap" {
574574 try expectEqual(@as(u32, 1), queue.remove());
575575}
576576
577test "std.PriorityQueue: update after remove" {
577test "update after remove" {
578578 var queue = PQlt.init(testing.allocator, {});
579579 defer queue.deinit();
580580
......@@ -583,7 +583,7 @@ test "std.PriorityQueue: update after remove" {
583583 try expectError(error.ElementNotFound, queue.update(1, 1));
584584}
585585
586test "std.PriorityQueue: siftUp in remove" {
586test "siftUp in remove" {
587587 var queue = PQlt.init(testing.allocator, {});
588588 defer queue.deinit();
589589
......@@ -603,7 +603,7 @@ fn contextLessThan(context: []const u32, a: usize, b: usize) Order {
603603
604604const CPQlt = PriorityQueue(usize, []const u32, contextLessThan);
605605
606test "std.PriorityQueue: add and remove min heap with contextful comparator" {
606test "add and remove min heap with contextful comparator" {
607607 const context = [_]u32{ 5, 3, 4, 2, 2, 8, 0 };
608608
609609 var queue = CPQlt.init(testing.allocator, context[0..]);
lib/std/segmented_list.zig+2-2
......@@ -408,7 +408,7 @@ pub fn SegmentedList(comptime T: type, comptime prealloc_item_count: usize) type
408408 };
409409}
410410
411test "SegmentedList basic usage" {
411test "basic usage" {
412412 try testSegmentedList(0);
413413 try testSegmentedList(1);
414414 try testSegmentedList(2);
......@@ -507,7 +507,7 @@ fn testSegmentedList(comptime prealloc: usize) !void {
507507 try list.setCapacity(testing.allocator, 0);
508508}
509509
510test "std.segmented_list clearRetainingCapacity" {
510test "clearRetainingCapacity" {
511511 var list = SegmentedList(i32, 1){};
512512 defer list.deinit(testing.allocator);
513513
lib/std/treap.zig+1-1
......@@ -349,7 +349,7 @@ fn SliceIterRandomOrder(comptime T: type) type {
349349const TestTreap = Treap(u64, std.math.order);
350350const TestNode = TestTreap.Node;
351351
352test "std.Treap: insert, find, replace, remove" {
352test "insert, find, replace, remove" {
353353 var treap = TestTreap{};
354354 var nodes: [10]TestNode = undefined;
355355
lib/std/wasm.zig+2-2
......@@ -201,7 +201,7 @@ pub fn opcode(op: Opcode) u8 {
201201 return @intFromEnum(op);
202202}
203203
204test "Wasm - opcodes" {
204test "opcodes" {
205205 // Ensure our opcodes values remain intact as certain values are skipped due to them being reserved
206206 const i32_const = opcode(.i32_const);
207207 const end = opcode(.end);
......@@ -625,7 +625,7 @@ pub fn reftype(value: RefType) u8 {
625625 return @intFromEnum(value);
626626}
627627
628test "Wasm - valtypes" {
628test "valtypes" {
629629 const _i32 = valtype(.i32);
630630 const _i64 = valtype(.i64);
631631 const _f32 = valtype(.f32);