Sha256: d6b859e69463cb17989a6e475249bad47e2b34e2d3f05fc414cd9e3e51fb0ff3
Contents?: true
Size: 591 Bytes
Versions: 107
Compression:
Stored size: 591 Bytes
Contents
package prime import "testing" func TestNth(t *testing.T) { for _, test := range tests { switch p, ok := Nth(test.n); { case !ok: if test.ok { t.Fatalf("FAIL %s\nNth(%d) returned !ok. Expecting ok.", test.description, test.n) } case !test.ok: t.Fatalf("FAIL %s\nNth(%d) = %d, ok = %t. Expecting !ok.", test.description, test.n, p, ok) case p != test.p: t.Fatalf("FAIL %s\nNth(%d) = %d, want %d.", test.description, test.n, p, test.p) } t.Logf("PASS %s", test.description) } } func BenchmarkNth(b *testing.B) { for i := 0; i < b.N; i++ { Nth(10001) } }
Version data entries
107 entries across 107 versions & 1 rubygems