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