aboutsummaryrefslogtreecommitdiff
path: root/go/game/cardImplementations_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/cardImplementations_test.go')
-rw-r--r--go/game/cardImplementations_test.go25
1 files changed, 25 insertions, 0 deletions
diff --git a/go/game/cardImplementations_test.go b/go/game/cardImplementations_test.go
index 51aab02f..43d69b76 100644
--- a/go/game/cardImplementations_test.go
+++ b/go/game/cardImplementations_test.go
@@ -394,3 +394,28 @@ func TestReformer(t *testing.T) {
t.Fatal("not two cards drawn")
}
}
+
+func TestSailor(t *testing.T) {
+ mapDef := `map: |+1
+ HW
+symbols:
+ H: house
+ W: deep water
+`
+ s, m, p, _ := newMockStateFromDef(mapDef)
+ sailor := s.addNewUnit(NewCard("nautics/sailor"), Position{0, 0}, p)
+ fisher := s.addNewUnit(NewCard("nautics/fisher"), Position{1, 0}, p)
+
+ _, err := sailor.XEffect("crew")
+ if err == nil {
+ t.Fatal("sailor is crewable")
+ }
+
+ ma := NewMoveAction(sailor)
+ ma.Target().AddSelection(m.TileAt(Position{1, 0}))
+ s.ResolveAction(ma)
+
+ if fisher.Movement.Range != 3 {
+ t.Fatal("sailor not adding movement to fisher")
+ }
+}