File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,13 @@ pub fn build(b: *Builder) void {
55 const optimize = b .standardOptimizeOption (.{});
66
77 var main_tests = b .addTest (.{
8- .name = "main test suite" ,
98 .root_source_file = .{ .path = "src/main.zig" },
109 .target = target ,
1110 .optimize = optimize ,
1211 });
1312
13+ const run_main_tests = b .addRunArtifact (main_tests );
14+
1415 const test_step = b .step ("test" , "Run library tests" );
15- test_step .dependOn (& main_tests .step );
16+ test_step .dependOn (& run_main_tests .step );
1617}
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ pub fn bitap(
3131 var R : Int = ~ one ;
3232 var pattern_mask = [_ ]Int {std .math .maxInt (Int )} ** possible_values ;
3333
34- for (pattern ) | x , i | {
34+ for (pattern , 0 .. ) | x , i | {
3535 pattern_mask [x ] &= ~ (one << @intCast (Log2Int , i ));
3636 }
3737
38- for (text ) | x , i | {
38+ for (text , 0 .. ) | x , i | {
3939 R |= pattern_mask [x ];
4040 R <<= 1 ;
4141
Original file line number Diff line number Diff line change @@ -53,9 +53,9 @@ pub fn StringFinder(comptime T: type) type {
5353 const last = pattern .len - 1 ;
5454
5555 // Initialize bad character rule table
56- for (self .bad_char ) | * x | x .* = pattern .len ;
56+ for (& self .bad_char ) | * x | x .* = pattern .len ;
5757
58- for (pattern ) | x , i | {
58+ for (pattern , 0 .. ) | x , i | {
5959 if (i == last ) break ;
6060 self .bad_char [x ] = last - i ;
6161 }
You can’t perform that action at this time.
0 commit comments