Sha256: 7b6c24a405c8b3c85840f0a6f2f86055c20bc8ebd3ccd8f6419529c24e57ff76

Contents?: true

Size: 666 Bytes

Versions: 57

Compression:

Stored size: 666 Bytes

Contents

package wordcount

import (
	"reflect"
	"testing"
)

const targetTestVersion = 2

func TestWordCount(t *testing.T) {
	if testVersion != targetTestVersion {
		t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
	}
	for _, tt := range testCases {
		expected := tt.output
		actual := WordCount(tt.input)
		if !reflect.DeepEqual(actual, expected) {
			t.Fatalf("%s\n\tExpected: %v\n\tGot: %v", tt.description, expected, actual)
		} else {
			t.Logf("PASS: %s - WordCount(%s)", tt.description, tt.input)
		}
	}
}

func BenchmarkWordCount(b *testing.B) {
	for i := 0; i < b.N; i++ {
		for _, tt := range testCases {
			WordCount(tt.input)
		}
	}
}

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
trackler-2.0.6.1 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.6.0 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.18 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.17 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.16 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.15 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.14 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.13 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.12 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.11 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.10 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.9 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.8 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.7 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.6 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.5 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.4 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.3 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.2 tracks/go/exercises/word-count/word_count_test.go
trackler-2.0.5.1 tracks/go/exercises/word-count/word_count_test.go