| ... | @@ -235,6 +235,7 @@ sanitize_coverage_trace_pc_guard: ?bool = null, | ... | @@ -235,6 +235,7 @@ sanitize_coverage_trace_pc_guard: ?bool = null, |
| 235 | pub const ExpectedCompileErrors = union(enum) { | 235 | pub const ExpectedCompileErrors = union(enum) { |
| 236 | contains: []const u8, | 236 | contains: []const u8, |
| 237 | exact: []const []const u8, | 237 | exact: []const []const u8, |
| | 238 | starts_with: []const u8, |
| 238 | }; | 239 | }; |
| 239 | | 240 | |
| 240 | pub const Entry = union(enum) { | 241 | pub const Entry = union(enum) { |
| ... | @@ -1958,6 +1959,17 @@ fn checkCompileErrors(compile: *Compile) !void { | ... | @@ -1958,6 +1959,17 @@ fn checkCompileErrors(compile: *Compile) !void { |
| 1958 | | 1959 | |
| 1959 | // TODO merge this with the testing.expectEqualStrings logic, and also CheckFile | 1960 | // TODO merge this with the testing.expectEqualStrings logic, and also CheckFile |
| 1960 | switch (expect_errors) { | 1961 | switch (expect_errors) { |
| | 1962 | .starts_with => |expect_starts_with| { |
| | 1963 | if (std.mem.startsWith(u8, actual_stderr, expect_starts_with)) return; |
| | 1964 | return compile.step.fail( |
| | 1965 | \\ |
| | 1966 | \\========= should start with: ============ |
| | 1967 | \\{s} |
| | 1968 | \\========= but not found: ================ |
| | 1969 | \\{s} |
| | 1970 | \\========================================= |
| | 1971 | , .{ expect_starts_with, actual_stderr }); |
| | 1972 | }, |
| 1961 | .contains => |expect_line| { | 1973 | .contains => |expect_line| { |
| 1962 | while (actual_line_it.next()) |actual_line| { | 1974 | while (actual_line_it.next()) |actual_line| { |
| 1963 | if (!matchCompileError(actual_line, expect_line)) continue; | 1975 | if (!matchCompileError(actual_line, expect_line)) continue; |