Sha256: 225e070d2e9415e366114be79b8e4a6979287c52b80597d0722f61f25f00c6c3
Contents?: true
Size: 543 Bytes
Versions: 107
Compression:
Stored size: 543 Bytes
Contents
package prime // Return prime factors in increasing order import ( "reflect" "testing" ) func TestPrimeFactors(t *testing.T) { for _, test := range tests { actual := Factors(test.input) if !reflect.DeepEqual(actual, test.expected) { t.Fatalf("FAIL %s\nFactors(%d) = %#v;\nexpected %#v", test.description, test.input, actual, test.expected) } t.Logf("PASS %s", test.description) } } func BenchmarkPrimeFactors(b *testing.B) { for i := 0; i < b.N; i++ { for _, test := range tests { Factors(test.input) } } }
Version data entries
107 entries across 107 versions & 1 rubygems