@@ -33,15 +33,15 @@ pub fn addArgs(clar: *ClarTestStep, args: []const []const u8) void {
33
33
for (args ) | arg | clar .addArg (arg );
34
34
}
35
35
36
- fn make (step : * Step , options : std.Build. Step.MakeOptions ) ! void {
36
+ fn make (step : * Step , options : Step.MakeOptions ) ! void {
37
37
const clar : * ClarTestStep = @fieldParentPtr ("step" , step );
38
38
const b = step .owner ;
39
39
const arena = b .allocator ;
40
40
41
41
var man = b .graph .cache .obtain ();
42
42
defer man .deinit ();
43
43
44
- var argv_list = std .ArrayList ([]const u8 ).init (arena );
44
+ var argv_list : std .ArrayList ([]const u8 ) = .init (arena );
45
45
{
46
46
const file_path = clar .runner .installed_path orelse clar .runner .generated_bin .? .path .? ;
47
47
try argv_list .append (file_path );
@@ -60,7 +60,7 @@ fn make(step: *Step, options: std.Build.Step.MakeOptions) !void {
60
60
}
61
61
62
62
{
63
- var child = std .process .Child .init (argv_list .items , arena );
63
+ var child : std.process.Child = .init (argv_list .items , arena );
64
64
child .stdin_behavior = .Ignore ;
65
65
child .stdout_behavior = .Pipe ;
66
66
child .stderr_behavior = .Ignore ;
@@ -162,12 +162,12 @@ const TapParser = struct {
162
162
fn parseLine (p : * TapParser , step_arena : Allocator , line : []const u8 ) Allocator.Error ! Result {
163
163
loop : switch (p .state ) {
164
164
.start = > {
165
- if (std . mem .startsWith (u8 , line , keyword .suite_start )) {
165
+ if (mem .startsWith (u8 , line , keyword .suite_start )) {
166
166
const suite_start = skip (line , keyword .spacer2 , keyword .suite_start .len ) orelse @panic ("expected suite number" );
167
167
return .{ .start_suite = line [suite_start .. ] };
168
- } else if (std . mem .startsWith (u8 , line , keyword .ok )) {
168
+ } else if (mem .startsWith (u8 , line , keyword .ok )) {
169
169
return .ok ;
170
- } else if (std . mem .startsWith (u8 , line , keyword .not_ok )) {
170
+ } else if (mem .startsWith (u8 , line , keyword .not_ok )) {
171
171
p .state = .desc ;
172
172
continue :loop p .state ;
173
173
}
@@ -176,37 +176,37 @@ const TapParser = struct {
176
176
// Failure parsing
177
177
.desc = > {
178
178
const name_start = skip (line , keyword .spacer1 , keyword .not_ok .len ) orelse @panic ("expected spacer" );
179
- const name = std . mem .trim (u8 , line [name_start .. ], & std .ascii .whitespace );
179
+ const name = mem .trim (u8 , line [name_start .. ], & std .ascii .whitespace );
180
180
try p .wip_failure .description .appendSlice (step_arena , name );
181
181
try p .wip_failure .description .appendSlice (step_arena , ": " );
182
182
p .state = .yaml_start ;
183
183
},
184
184
.yaml_start = > {
185
- _ = std . mem .indexOf (u8 , line , keyword .yaml_blk ) orelse @panic ("expected yaml_blk" );
185
+ _ = mem .indexOf (u8 , line , keyword .yaml_blk ) orelse @panic ("expected yaml_blk" );
186
186
p .state = .pre_reason ;
187
187
},
188
188
.pre_reason = > {
189
- _ = std . mem .indexOf (u8 , line , keyword .pre_reason ) orelse @panic ("expected pre_reason" );
189
+ _ = mem .indexOf (u8 , line , keyword .pre_reason ) orelse @panic ("expected pre_reason" );
190
190
p .state = .reason ;
191
191
},
192
192
.reason = > {
193
- if (std . mem .indexOf (u8 , line , keyword .at ) != null ) {
193
+ if (mem .indexOf (u8 , line , keyword .at ) != null ) {
194
194
p .state = .file ;
195
195
} else {
196
- const ln = std . mem .trim (u8 , line , & std .ascii .whitespace );
196
+ const ln = mem .trim (u8 , line , & std .ascii .whitespace );
197
197
try p .wip_failure .reasons .append (step_arena , try step_arena .dupe (u8 , ln ));
198
198
}
199
199
},
200
200
.file = > {
201
201
const file_start = skip (line , keyword .file , 0 ) orelse @panic ("expected file" );
202
- const file = std . mem .trim (u8 , line [file_start .. ], std .ascii .whitespace ++ "'" );
202
+ const file = mem .trim (u8 , line [file_start .. ], std .ascii .whitespace ++ "'" );
203
203
try p .wip_failure .description .appendSlice (step_arena , file );
204
204
try p .wip_failure .description .append (step_arena , ':' );
205
205
p .state = .line ;
206
206
},
207
207
.line = > {
208
208
const line_start = skip (line , keyword .line , 0 ) orelse @panic ("expected line" );
209
- const fail_line = std . mem .trim (u8 , line [line_start .. ], & std .ascii .whitespace );
209
+ const fail_line = mem .trim (u8 , line [line_start .. ], & std .ascii .whitespace );
210
210
try p .wip_failure .description .appendSlice (step_arena , fail_line );
211
211
p .state = .start ;
212
212
return .{ .failure = p .wip_failure };
@@ -217,7 +217,7 @@ const TapParser = struct {
217
217
}
218
218
219
219
fn skip (line : []const u8 , to_skip : []const u8 , start : usize ) ? usize {
220
- const index = std . mem .indexOfPos (u8 , line , start , to_skip ) orelse return null ;
220
+ const index = mem .indexOfPos (u8 , line , start , to_skip ) orelse return null ;
221
221
return to_skip .len + index ;
222
222
}
223
223
@@ -235,5 +235,6 @@ const TapParser = struct {
235
235
};
236
236
237
237
const std = @import ("std" );
238
+ const mem = std .mem ;
238
239
const Step = std .Build .Step ;
239
- const Allocator = std . mem .Allocator ;
240
+ const Allocator = mem .Allocator ;
0 commit comments