diff options
| author | Michael Tews <git@tews.dev> | 2024-06-19 05:30:53 +0200 |
|---|---|---|
| committer | Michael Tews <michael@tews.dev> | 2026-04-12 11:11:01 +0200 |
| commit | aa09a369f481c935455b8cc5e35a82617cc5ec0c (patch) | |
| tree | aec9299a20605af2c6471886f4c774f95b22b86c | |
| parent | 5cc4864ae2c10aa27e9a1d10fe0478f2048f930c (diff) | |
test(lexer): updates NextToken test with the new tokens
| -rw-r--r-- | lexer/lexer_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lexer/lexer_test.go b/lexer/lexer_test.go index b00a71e..5706209 100644 --- a/lexer/lexer_test.go +++ b/lexer/lexer_test.go @@ -16,6 +16,8 @@ func TestNextToken(t *testing.T) { }; let result = add(five, ten); + !-/*5; + 5 < 10 > 5; ` tests := []struct { @@ -58,6 +60,18 @@ func TestNextToken(t *testing.T) { {token.IDENT, "ten"}, {token.RPAREN, ")"}, {token.SEMICOLON, ";"}, + {token.BANG, "!"}, + {token.MINUS, "-"}, + {token.SLASH, "/"}, + {token.ASTERISK, "*"}, + {token.INT, "5"}, + {token.SEMICOLON, ";"}, + {token.INT, "5"}, + {token.LT, "<"}, + {token.INT, "10"}, + {token.GT, ">"}, + {token.INT, "5"}, + {token.SEMICOLON, ";"}, {token.EOF, ""}, } |
