This commit is contained in:
Richard Feldman 2022-01-02 22:16:51 -05:00
parent bf582b8120
commit e324366ecf

View file

@ -233,12 +233,7 @@ pub fn expectFailed(
start_col: u16,
end_col: u16,
) void {
const new_failure = Failure{
.start_line = start_line,
.end_line = end_line,
.start_col = start_col,
.end_col = end_col
};
const new_failure = Failure{ .start_line = start_line, .end_line = end_line, .start_col = start_col, .end_col = end_col };
if (failure_length >= failure_capacity) {
failure_capacity += 4096;
@ -260,7 +255,6 @@ pub fn expectFailedC (
return @call(.{ .modifier = always_inline }, expectFailed, .{ start_line, end_line, start_col, end_col });
}
pub fn getExpectFailures() []Failure {
return failures[0..failure_length];
}
@ -354,11 +348,6 @@ test "expectFailure does something"{
try std.testing.expectEqual(getExpectFailures().len, 0);
expectFailed(1, 2, 3, 4);
try std.testing.expectEqual(getExpectFailures().len, 1);
const what_it_should_look_like = Failure{
.start_line = 1,
.end_line = 2,
.start_col = 3,
.end_col = 4
};
const what_it_should_look_like = Failure{ .start_line = 1, .end_line = 2, .start_col = 3, .end_col = 4 };
try std.testing.expectEqual(getExpectFailures()[0], what_it_should_look_like);
}