diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-03-31 01:43:07 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-03-31 01:43:07 +0200 |
commit | d4a7fdfbce83811aeecf692674cfb411bc2b4089 (patch) | |
tree | 2e23c2835894a9fa700a45bbc43f9e54725fe7e4 | |
parent | 8f9e1935429e7c12312e62f343e50282c770d77e (diff) | |
download | refcat-d4a7fdfbce83811aeecf692674cfb411bc2b4089.tar.gz refcat-d4a7fdfbce83811aeecf692674cfb411bc2b4089.zip |
add test
-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) + } + } +} |