// TestPrecompute ensures we are trimming and UTF-8 normalizing strings
// as expected. This is needed since our datafiles are normalized for us.
TestPrecompute ensures we are trimming and UTF-8 normalizing strings
as expected. This is needed since our datafiles are normalized for us.
// TestPrecompute ensures we are trimming and UTF - 8 normalizing strings // as expected . This is needed since our datafiles are normalized for us .
func TestPrecompute(t *testing.T) {
	cases := []struct {
		input, expected string
	}{
		{"nicolás maduro", "nicolas maduro"},
		{"Delcy Rodríguez", "delcy rodriguez"},
		{"Raúl Castro", "raul castro"},
		{"ANGLO-CARIBBEAN ", "anglo caribbean"},
	}
	for i := range cases {
		guess := precompute(cases[i].input)
		if guess != cases[i].expected {
			t.Errorf("precompute(%q)=%q expected %q", cases[i].input, guess, cases[i].expected)
		}
	}
}
func TestPrecompute ( t * testing . T ) { cases := [ ] struct { input , expected string } { { " , n } , { " , d } , { " , r } , { " " , " " } , } for i := range cases { guess := precompute ( cases [ i ] . input ) if guess != cases [ i ] . expected { t . Errorf ( " " , cases [ i ] . input , guess , cases [ i ] . expected ) } } }
TestPrecompute ensures we are trimming and UTF-8 normalizing strings
as expected.
TestPrecompute ensures we are trimming and UTF - 8 normalizing strings as expected .