]> git.scottworley.com Git - planeteer/blame_incremental - planeteer_test.go
Print total cost of fighters and shields
[planeteer] / planeteer_test.go
... / ...
CommitLineData
1package main
2
3import "testing"
4
5func TestEncodeDecode(t *testing.T) {
6 dims := []int{3, 2, 4, 17, 26, 15, 2, 1, 2, 1}
7 var i int32
8 for i = 0; i < 636480; i++ { // Product of dims
9 addr := DecodeIndex(dims, i)
10 for j := 0; j < len(dims); j++ {
11 if addr[j] >= dims[j] {
12 t.Fail()
13 }
14 }
15 if EncodeIndex(dims, addr) != i {
16 t.Fail()
17 }
18 }
19}