MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / TestIsIsogram

Function TestIsIsogram

strings/isisogram_test.go:117–131  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

115}
116
117func TestIsIsogram(t *testing.T) {
118 for _, test := range testCases {
119 t.Run(test.name, func(t *testing.T) {
120 actualVal, actualErr := strings.IsIsogram(test.input, test.order)
121
122 if actualErr != nil && test.expectedErr.Error() != actualErr.Error() {
123 t.Errorf("Expected to be '%v' for string %s but was '%v'.", test.expectedErr, test.input, actualErr)
124 }
125
126 if test.expectedVal != actualVal {
127 t.Errorf("Expected to be '%v' for string %s but was '%v'.", test.expectedVal, test.input, actualVal)
128 }
129 })
130 }
131}

Callers

nothing calls this directly

Calls 1

IsIsogramFunction · 0.92

Tested by

no test coverage detected