aboutsummaryrefslogtreecommitdiffstats
path: root/skate/nysiis_test.go
blob: 80500ec11418765c31b0727ba2ad924de31f20e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
		}
	}
}