File tree 1 file changed +4
-7
lines changed
1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -2061,17 +2061,14 @@ test "saturating operators" {
2061
2061
try testTokenize ("-|=" , &.{.minus_pipe_equal });
2062
2062
}
2063
2063
2064
- fn testTokenize (source : [:0 ]const u8 , expected_tokens : []const Token.Tag ) ! void {
2064
+ fn testTokenize (source : [:0 ]const u8 , expected_token_tags : []const Token.Tag ) ! void {
2065
2065
var tokenizer = Tokenizer .init (source );
2066
- for (expected_tokens ) | expected_token_id | {
2066
+ for (expected_token_tags ) | expected_token_tag | {
2067
2067
const token = tokenizer .next ();
2068
- if (token .tag != expected_token_id ) {
2069
- std .debug .panic ("expected {s}, found {s}\n " , .{
2070
- @tagName (expected_token_id ), @tagName (token .tag ),
2071
- });
2072
- }
2068
+ try std .testing .expectEqual (expected_token_tag , token .tag );
2073
2069
}
2074
2070
const last_token = tokenizer .next ();
2075
2071
try std .testing .expectEqual (Token .Tag .eof , last_token .tag );
2076
2072
try std .testing .expectEqual (source .len , last_token .loc .start );
2073
+ try std .testing .expectEqual (source .len , last_token .loc .end );
2077
2074
}
You can’t perform that action at this time.
0 commit comments