(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func TestMu(t *testing.T) { |
| 15 | var tests = []struct { |
| 16 | n int |
| 17 | expected int |
| 18 | }{ |
| 19 | {-1, 1}, |
| 20 | {0, 1}, |
| 21 | {2, -1}, |
| 22 | {3, -1}, |
| 23 | {95, 1}, |
| 24 | {97, -1}, |
| 25 | {98, 0}, |
| 26 | {99, 0}, |
| 27 | {100, 0}, |
| 28 | } |
| 29 | for _, test := range tests { |
| 30 | result := algmath.Mu(test.n) |
| 31 | t.Log(test.n, " ", result) |
| 32 | if result != test.expected { |
| 33 | t.Errorf("Wrong result! Expected:%v, returned:%v ", test.expected, result) |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | func BenchmarkMu(b *testing.B) { |
| 38 | for i := 0; i < b.N; i++ { |
| 39 | algmath.Mu(65536) |
nothing calls this directly
no outgoing calls
no test coverage detected