diff options
-rw-r--r-- | skate/nysiis_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/skate/nysiis_test.go b/skate/nysiis_test.go new file mode 100644 index 0000000..80500ec --- /dev/null +++ b/skate/nysiis_test.go @@ -0,0 +1,24 @@ +package skate + +import "testing" + +func TestNYSIIS(t *testing.T) { + var cases = []struct { + s string + result string + }{ + {"", ""}, + {"hello", "HAL"}, + {"world", "WARLD"}, + {"john", "JAN"}, + {"jon", "JAN"}, + {"jon???", "JAN"}, + {"Jonn", "JAN"}, + } + for _, c := range cases { + result := NYSIIS(c.s) + if result != c.result { + t.Fatalf("got %v, want %v", result, c.result) + } + } +} |