Sha256: a1086af266b3d01802453114cd5761f7cede9b7c58c9440df2a5fb9f254c2223
Contents?: true
Size: 487 Bytes
Versions: 77
Compression:
Stored size: 487 Bytes
Contents
package space import ( "math" "testing" ) func TestAge(t *testing.T) { const precision = 0.01 for _, tc := range testCases { if actual := Age(tc.seconds, tc.planet); math.Abs(actual-tc.expected) > precision { t.Fatalf("FAIL: %s\nExpected: %#v\nActual: %#v", tc.description, tc.expected, actual) } t.Logf("PASS: %s", tc.description) } } func BenchmarkAge(b *testing.B) { for i := 0; i < b.N; i++ { for _, tc := range testCases { Age(tc.seconds, tc.planet) } } }
Version data entries
77 entries across 77 versions & 1 rubygems