From d4a7fdfbce83811aeecf692674cfb411bc2b4089 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Wed, 31 Mar 2021 01:43:07 +0200 Subject: add test --- skate/nysiis_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 skate/nysiis_test.go 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) + } + } +} -- cgit v1.2.3