Sha256: 800e8abab3e683654f313683ae138d73e11081622094d0d8c8a392642f138867

Contents?: true

Size: 762 Bytes

Versions: 102

Compression:

Stored size: 762 Bytes

Contents

// +build asktoomuch

package slice

import "testing"

func TestAskTooMuch(t *testing.T) {
	test := allTests[0]
	defer func() {
		if recover() != nil {
			t.Fatalf("Yikes, UnsafeFirst(%d, %s) panicked!", test.n, test.s)
		}
	}()
	for _, test = range allTests {
		switch res := UnsafeFirst(test.n, test.s); {
		case len(test.out) > 0: // well, this should work
			if res != test.out[0] {
				t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, want %q.",
					test.n, test.s, res, test.out[0])
			}
		case len(res) != test.n:
			t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, but %q doesn't have %d characters.",
				test.n, test.s, res, res, test.n)
		default:
			t.Fatalf("Yikes, UnsafeFirst(%d, %s) = %q, but %q isn't in %q",
				test.n, test.s, res, res, test.s)
		}
	}
}

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
trackler-2.0.5.5 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.5.4 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.5.3 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.5.2 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.5.1 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.5.0 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.4.0 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.9 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.8 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.7 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.6 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.5 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.4 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.3 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.2 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.1 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.3.0 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.2.0 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.1.2 tracks/go/exercises/series/asktoomuch_test.go
trackler-2.0.1.1 tracks/go/exercises/series/asktoomuch_test.go