Sha256: 9c22313520b42a1e15e03ec3f6147b0d3a5241e54d812c97baab6468c147d090
Contents?: true
Size: 761 Bytes
Versions: 92
Compression:
Stored size: 761 Bytes
Contents
package alphametics import ( "reflect" "testing" ) func TestSolve(t *testing.T) { for _, tc := range testCases { s, err := Solve(tc.input) if tc.errorExpected { if err == nil { t.Fatalf("FAIL: %s\nSolve(%q)\nExpected error\nActual: %#v", tc.description, tc.input, s) } } else if err != nil { t.Fatalf("FAIL: %s\nSolve(%q)\nExpected: %#v\nGot error: %q", tc.description, tc.input, tc.expected, err) } else if !reflect.DeepEqual(s, tc.expected) { t.Fatalf("FAIL: %s\nSolve(%q)\nExpected: %#v\nActual: %#v", tc.description, tc.input, tc.expected, s) } t.Logf("PASS: %s", tc.description) } } func BenchmarkSolve(b *testing.B) { for i := 0; i < b.N; i++ { for _, tc := range testCases { Solve(tc.input) } } }
Version data entries
92 entries across 92 versions & 1 rubygems