diff options
Diffstat (limited to '')
-rw-r--r-- | users/fcuny/exp/monkey/pkg/lexer/lexer_test.go | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/users/fcuny/exp/monkey/pkg/lexer/lexer_test.go b/users/fcuny/exp/monkey/pkg/lexer/lexer_test.go index ba7fa07..22dbfcb 100644 --- a/users/fcuny/exp/monkey/pkg/lexer/lexer_test.go +++ b/users/fcuny/exp/monkey/pkg/lexer/lexer_test.go @@ -5,38 +5,7 @@ import ( "testing" ) -func TestNextTokenBasic(t *testing.T) { - input := `=+(){},;` - - tests := []struct { - expectedType token.TokenType - expectedLiteral string - }{ - {token.ASSIGN, "="}, - {token.PLUS, "+"}, - {token.LPAREN, "("}, - {token.RPAREN, ")"}, - {token.LBRACE, "{"}, - {token.RBRACE, "}"}, - {token.COMMA, ","}, - {token.SEMICOLON, ";"}, - } - - l := New(input) - - for i, tt := range tests { - tok := l.NextToken() - if tok.Type != tt.expectedType { - t.Fatalf("tests[%d] - tokentype wrong. expected=%q, got=%q", i, tt.expectedType, tok.Type) - } - - if tok.Literal != tt.expectedLiteral { - t.Fatalf("tests[%d] - tokenliteral wrong. expected=%q, got=%q", i, tt.expectedLiteral, tok.Literal) - } - } -} - -func TestNextTokenMonkey(t *testing.T) { +func TestNextToken(t *testing.T) { input := `let five = 5; let ten = 10; |