diff --git a/strmangle/strmangle_test.go b/strmangle/strmangle_test.go index e96ed3b..1526aa7 100644 --- a/strmangle/strmangle_test.go +++ b/strmangle/strmangle_test.go @@ -300,7 +300,6 @@ func TestPrefixStringSlice(t *testing.T) { t.Error("wrong output:", got) } } - func TestWhereClause(t *testing.T) { t.Parallel() @@ -309,15 +308,15 @@ func TestWhereClause(t *testing.T) { Start int Should string }{ - {Cols: []string{"col1", "col2"}, Start: 2, Should: `("col1"=$2 AND "col2"=$3 AND "col1"=$4 AND "col2"=$5)`}, - {Cols: []string{"col1", "col2"}, Start: 4, Should: `("col1"=$4 AND "col2"=$5 AND "col1"=$6 AND "col2"=$7)`}, - {Cols: []string{"col1", "col2", "col3"}, Start: 4, Should: `("col1"=$4 AND "col2"=$5 AND "col3"=$6)`}, + {Cols: []string{"col1"}, Start: 2, Should: `"col1"=$2`}, + {Cols: []string{"col1", "col2"}, Start: 4, Should: `"col1"=$4 AND "col2"=$5`}, + {Cols: []string{"col1", "col2", "col3"}, Start: 4, Should: `"col1"=$4 AND "col2"=$5 AND "col3"=$6`}, } for i, test := range tests { r := WhereClause(test.Start, test.Cols) if r != test.Should { - t.Errorf("(%d) want: %s, got: %s", i, test.Should, r) + t.Errorf("(%d) want: %s, got: %s\nTest: %#v", i, test.Should, r, test) } } }