Skip to content

Instantly share code, notes, and snippets.

@alextanhongpin
Created March 9, 2017 09:21
Show Gist options
  • Save alextanhongpin/27f7cd910696e464c5cf967585f8028d to your computer and use it in GitHub Desktop.
Save alextanhongpin/27f7cd910696e464c5cf967585f8028d to your computer and use it in GitHub Desktop.
package isogram
import (
"testing"
)
// booB #2nd order isogram
// Caucasus # 2nd order isogram
// geggee # 3rd order
func TestIsIsogram(t *testing.T) {
output := IsIsogram("Dermatoglyphics")
if output != true {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, true)
}
}
func TestSecondOrderIsogram(t *testing.T) {
output := IsIsogram("booB")
if output != true {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, true)
}
output = IsIsogram("Caucasus")
if output != true {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, true)
}
}
func TestThirdOrderIsogram(t *testing.T) {
output := IsIsogram("geggee")
if output != true {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, true)
}
}
func TestIsNotIsogram(t *testing.T) {
output := IsIsogram("aba")
if output != false {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, false)
}
output = IsIsogram("moOse")
if output != false {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, false)
}
output = IsIsogram("booBsB")
if output != false {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, false)
}
output = IsIsogram("vexes")
if output != false {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, false)
}
output = IsIsogram("MOose")
if output != false {
t.Errorf("Result was incorrect, got: %t, want: %t.", output, false)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment