aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lexer_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/lexer_test.go b/lexer_test.go
index 22cb12e..785a810 100644
--- a/lexer_test.go
+++ b/lexer_test.go
@@ -2,7 +2,7 @@ package main
import "testing"
-func testInput(t *testing.T, s []string, ty int) {
+func testInput(t *testing.T, ty int, s ...string) {
for _, input := range s {
l := lex(input + "\n")
typ, s := l.Lex()
@@ -16,21 +16,21 @@ func testInput(t *testing.T, s []string, ty int) {
}
func TestInteger(t *testing.T) {
- testInput(t, []string{"1", "¯1", "123"}, INTEGER)
+ testInput(t, INTEGER, "1", "¯1", "123")
}
func TestFloat(t *testing.T) {
- testInput(t, []string{"1.120", "¯1.1", "1e1", "¯1.1e¯1"}, FLOAT)
+ testInput(t, FLOAT, "1.120", "¯1.1", "1e1", "¯1.1e¯1")
}
func TestComplex(t *testing.T) {
- testInput(t, []string{"1.1J1", "¯1J1", "1J¯1.1", "¯1.1e1J¯1"}, COMPLEX)
+ testInput(t, COMPLEX, "1.1J1", "¯1J1", "1J¯1.1", "¯1.1e1J¯1")
}
func TestString(t *testing.T) {
- testInput(t, []string{"abc"}, STRING)
+ testInput(t, STRING, "abc")
}
func TestQuoted(t *testing.T) {
- testInput(t, []string{"'abc''xyz'"}, QUOTED)
+ testInput(t, QUOTED, "'abc''xyz'")
}