Sha256: e40641e5df30c7251cf27444c719a8d8dcf9609083bfd2abf9755640580000f6

Contents?: true

Size: 512 Bytes

Versions: 58

Compression:

Stored size: 512 Bytes

Contents

// +build first

package slice

import "testing"

func TestFirst(t *testing.T) {
	for _, test := range allTests {
		switch res, ok := First(test.n, test.s); {
		case !ok:
			if len(test.out) > 0 {
				t.Fatalf("First(%d, %q) returned !ok, want ok.",
					test.n, test.s)
			}
		case len(test.out) == 0:
			t.Fatalf("First(%d, %q) = %q, %t.  Expected ok == false",
				test.n, test.s, res, ok)
		case res != test.out[0]:
			t.Fatalf("First(%d, %q) = %q.  Want %q.",
				test.n, test.s, res, test.out[0])
		}
	}
}

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
trackler-2.1.0.4 tracks/go/exercises/series/first_test.go
trackler-2.1.0.3 tracks/go/exercises/series/first_test.go
trackler-2.1.0.2 tracks/go/exercises/series/first_test.go
trackler-2.1.0.1 tracks/go/exercises/series/first_test.go
trackler-2.1.0.0 tracks/go/exercises/series/first_test.go
trackler-2.0.8.55 tracks/go/exercises/series/first_test.go
trackler-2.0.8.54 tracks/go/exercises/series/first_test.go
trackler-2.0.8.53 tracks/go/exercises/series/first_test.go
trackler-2.0.8.52 tracks/go/exercises/series/first_test.go
trackler-2.0.8.51 tracks/go/exercises/series/first_test.go
trackler-2.0.8.50 tracks/go/exercises/series/first_test.go
trackler-2.0.8.49 tracks/go/exercises/series/first_test.go
trackler-2.0.8.48 tracks/go/exercises/series/first_test.go
trackler-2.0.8.47 tracks/go/exercises/series/first_test.go
trackler-2.0.8.46 tracks/go/exercises/series/first_test.go
trackler-2.0.8.45 tracks/go/exercises/series/first_test.go
trackler-2.0.8.44 tracks/go/exercises/series/first_test.go
trackler-2.0.8.43 tracks/go/exercises/series/first_test.go
trackler-2.0.8.42 tracks/go/exercises/series/first_test.go
trackler-2.0.8.41 tracks/go/exercises/series/first_test.go