Sha256: ced2477612b56f3901e78285057f8f1ff8f1aeb7948b4c26d6ba5af6916a0f19

Contents?: true

Size: 1007 Bytes

Versions: 78

Compression:

Stored size: 1007 Bytes

Contents

package isogram

import "testing"

var testCases = []struct {
	word     string
	expected bool
}{
	{"duplicates", true},
	{"eleven", false},
	{"subdermatoglyphic", true},
	{"Alphabet", false},
	{"thumbscrew-japingly", true},
	{"Hjelmqvist-Gryb-Zock-Pfund-Wax", true},
	{"Heizölrückstoßabdämpfung", true},
	{"the quick brown fox", false},
	{"Emily Jung Schwartzkopf", true},
	{"éléphant", false},
}

func TestIsIsogram(t *testing.T) {
	for _, c := range testCases {
		if IsIsogram(c.word) != c.expected {
			t.Fatalf("FAIL: Word %q, expected %v, got %v", c.word, c.expected, !c.expected)
		}

		t.Logf("PASS: Word %q", c.word)
	}
}

func BenchmarkIsIsogram(b *testing.B) {
	b.StopTimer()
	for _, c := range testCases {
		b.StartTimer()

		for i := 0; i < b.N; i++ {
			IsIsogram(c.word)
		}

		b.StopTimer()
	}
}

const targetTestVersion = 1

func TestTestVersion(t *testing.T) {
	if testVersion != targetTestVersion {
		t.Errorf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
	}
}

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
trackler-2.0.6.41 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.40 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.39 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.38 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.37 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.36 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.35 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.34 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.33 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.32 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.31 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.30 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.29 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.28 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.27 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.26 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.25 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.24 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.23 tracks/go/exercises/isogram/isogram_test.go
trackler-2.0.6.22 tracks/go/exercises/isogram/isogram_test.go