Sha256: c5edda1dbd483a88ff1d7c68397c9267e0458b425c8d37b27bedb86decd084d4

Contents?: true

Size: 1007 Bytes

Versions: 177

Compression:

Stored size: 1007 Bytes

Contents

package isogram

import "testing"

const targetTestVersion = 1

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 TestTestVersion(t *testing.T) {
	if testVersion != targetTestVersion {
		t.Fatalf("Found testVersion = %v, want %v.", testVersion, targetTestVersion)
	}
}

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()
	}
}

Version data entries

177 entries across 177 versions & 1 rubygems

Version Path
trackler-2.2.1.56 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.55 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.54 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.53 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.52 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.51 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.50 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.49 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.48 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.47 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.46 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.45 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.44 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.43 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.42 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.41 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.40 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.39 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.38 tracks/go/exercises/isogram/isogram_test.go
trackler-2.2.1.37 tracks/go/exercises/isogram/isogram_test.go