Sha256: b173d59ed6dc9b25bb61fdc3d8b15e4f7a37e8d54ecfd3ffe5b89cf3e35c1e07

Contents?: true

Size: 507 Bytes

Versions: 111

Compression:

Stored size: 507 Bytes

Contents

package sieve

import (
	"reflect"
	"testing"
)

func TestSieve(t *testing.T) {
	for _, tc := range testCases {
		p := Sieve(tc.limit)
		if len(p) != 0 || len(tc.expected) != 0 {
			if !reflect.DeepEqual(p, tc.expected) {
				t.Fatalf("FAIL: %s\nSieve(%d)\nExpected %v\nActual  %v",
					tc.description, tc.limit, tc.expected, p)
			}
		}
		t.Logf("PASS: %s", tc.description)
	}
}

func BenchmarkSieve(b *testing.B) {
	for i := 0; i < b.N; i++ {
		for _, tc := range testCases {
			Sieve(tc.limit)
		}
	}
}

Version data entries

111 entries across 111 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.179 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.178 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.177 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.176 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.175 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.174 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.173 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.172 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.171 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.170 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.169 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.167 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.166 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.165 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.164 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.163 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.162 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.161 tracks/go/exercises/sieve/sieve_test.go
trackler-2.2.1.160 tracks/go/exercises/sieve/sieve_test.go