Add small tokenizer test case for #3468

master
LemonBoy 2019-11-06 23:15:19 +01:00 committed by Andrew Kelley
parent 528908a06e
commit cf6fb89ced
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 10 additions and 0 deletions

View File

@ -1625,6 +1625,16 @@ test "tokenizer - UTF-8 BOM is recognized and skipped" {
});
}
test "correctly parse pointer assignment" {
testTokenize("b.*=3;\n", [_]Token.Id{
Token.Id.Identifier,
Token.Id.PeriodAsterisk,
Token.Id.Equal,
Token.Id.IntegerLiteral,
Token.Id.Semicolon,
});
}
fn testTokenize(source: []const u8, expected_tokens: []const Token.Id) void {
var tokenizer = Tokenizer.init(source);
for (expected_tokens) |expected_token_id| {