aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-24 17:32:11 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:30 +0200
commit146ef8462ac8f5f7424e1db4d779ea286aaf6822 (patch)
treec3eb6e53a59d3edd3480edea298c15939cab2154
parent91618ca8f900321eb3038fbbf6bfb4a507652009 (diff)
downloadmuhqs-game-146ef8462ac8f5f7424e1db4d779ea286aaf6822.tar.gz
muhqs-game-146ef8462ac8f5f7424e1db4d779ea286aaf6822.zip
make PoC Decklist test deterministic
-rw-r--r--go/game/pileOfCards_test.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/go/game/pileOfCards_test.go b/go/game/pileOfCards_test.go
index 75467b57..f1927b8c 100644
--- a/go/game/pileOfCards_test.go
+++ b/go/game/pileOfCards_test.go
@@ -3,6 +3,8 @@ package game
import (
"errors"
"testing"
+
+ "golang.org/x/exp/slices"
)
func TestPocToString(t *testing.T) {
@@ -98,9 +100,9 @@ func TestPocToList(t *testing.T) {
t.Fatal("poc size != 3:", poc.Size())
}
is := poc.ToList()
- exp := "2 base/archer\n1 base/knight"
- if is != exp {
- t.Fatal("is != exp:", is, exp)
+ exp := []string{"2 base/archer\n1 base/knight", "1 base/knight\n2 base/archer"}
+ if !slices.Contains(exp, is) {
+ t.Fatal("not expected cardList:", is)
}
}