authorgravatar for daniele.cocca@gmail.comDaniele Cocca <daniele.cocca@gmail.com> 2022-03-13 11:52:58+00:00
committergravatar for daniele.cocca@gmail.comDaniele Cocca <daniele.cocca@gmail.com> 2022-03-15 19:00:16+00:00
log9b5737b5a6c6dab61917d17ce9eec35e5978942b
tree0902b47b0d3620c782ac3bebef8c915d43601ffd
parent47e004d975669fea1297224e33a868742178c4b4

s/testClz/testCtz/g

The test name here was likely the result of a bad copy-paste, as the test code is actually testing for trailing zeroes, not leading zeroes.

1 files changed, 3 insertions(+), 3 deletions(-)

test/behavior/bugs/2114.zig+3-3
...@@ -7,11 +7,11 @@ fn ctz(x: anytype) usize {...@@ -7,11 +7,11 @@ fn ctz(x: anytype) usize {
7}7}
88
9test "fixed" {9test "fixed" {
10 try testClz();10 try testCtz();
11 comptime try testClz();11 comptime try testCtz();
12}12}
1313
14fn testClz() !void {14fn testCtz() !void {
15 try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);15 try expect(ctz(@as(u128, 0x40000000000000000000000000000000)) == 126);
16 try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));16 try expect(math.rotl(u128, @as(u128, 0x40000000000000000000000000000000), @as(u8, 1)) == @as(u128, 0x80000000000000000000000000000000));
17 try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);17 try expect(ctz(@as(u128, 0x80000000000000000000000000000000)) == 127);