aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bingo/board_test.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/bingo/board_test.go b/bingo/board_test.go
index 8d8b94f..a48eda5 100644
--- a/bingo/board_test.go
+++ b/bingo/board_test.go
@@ -1,13 +1,14 @@
package bingo_test
import (
+ "fmt"
"iter"
"testing"
"github.com/jpappel/bingo-factory/bingo"
)
-func TestRows(t *testing.T) {
+func TestIters(t *testing.T) {
g := bingo.Game{}
testGame := func(size int, length int) {
@@ -18,7 +19,9 @@ func TestRows(t *testing.T) {
for i := range size {
g.Board[i].Checked = false
}
+ count := 0
for group := range iter {
+ fmt.Println("!")
if len(group) != length {
t.Logf("Mismatching %s length: %d != %d", name, length, len(group))
t.FailNow()
@@ -29,7 +32,13 @@ func TestRows(t *testing.T) {
t.Errorf("Incorrect value in %s!\n", name)
}
}
+ count++
}
+
+ if count != 2 || count != size {
+ t.Errorf("Expected to iterate 2 or %d times, iterated %d\n", size, count)
+ }
+
for i := range size {
g.Board[i].Checked = true
}