about summary refs log tree commit diff
path: root/users/fcuny
diff options
context:
space:
mode:
authorfranck cuny <franck@fcuny.net>2020-01-11 14:01:49 +0100
committerfranck cuny <franck@fcuny.net>2020-01-11 14:17:39 +0100
commitbe6ab89f58b0572d0999701d4f1b454e98dec581 (patch)
tree36acc2238a4f21e604eed6a82c93219607cd75cd /users/fcuny
parentMakefile: add a Makefile (diff)
downloadworld-be6ab89f58b0572d0999701d4f1b454e98dec581.tar.gz
lexer: delete redundant test.
The test `TestNextTokenBasic` was not testing anything that
`TestNextTokenMonkey` was not already testing.

Rename `TestNextTokenMonkey` to `TestNextToken` for clarity.
Diffstat (limited to 'users/fcuny')
-rw-r--r--users/fcuny/exp/monkey/pkg/lexer/lexer_test.go33
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;