smallify_test.go (397B)
1 package main 2 3 import "testing" 4 5 type testsmallcmpT struct { 6 s string 7 l string 8 r bool 9 } 10 11 var testsmallcmp = []testsmallcmpT { 12 {"tst", "test", true}, 13 {"tst", "tests", false}, 14 {"tst", "ts", false}, 15 } 16 17 func TestSmallcmp(t *testing.T) { 18 for _, v := range testsmallcmp { 19 if Smallcmp(v.s, v.l) != v.r { 20 t.Fatalf("expected Smallcmp(\"%v\", \"%v\") to return %v\n", 21 v.s, v.l, v.r) 22 } 23 } 24 }