From 50d8fcfe69fce34fed41b006189fd827a124bf97 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sun, 22 Mar 2015 23:23:03 +0100 Subject: Switch to vararg --- lexer_test.go | 12 ++++++------ 1 file 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'") } -- cgit v1.2.3