algorithms/even/even_test.go

23 lines
455 B
Go
Raw Normal View History

2020-12-09 09:09:50 +00:00
package even
import "testing"
func TestEven(t *testing.T) {
suite := map[int]bool{
2: true,
1: false,
824: true,
200: true,
52: true,
1785616589187: false,
0: true,
100000000000000000: true,
}
for k, v := range suite {
if output := isEven(k); output != v {
t.Errorf("input: %d - expected: %v, got: %v", k, v, output)
}
}
}