aboutsummaryrefslogtreecommitdiff
path: root/go/game/areaEffect_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'go/game/areaEffect_test.go')
-rw-r--r--go/game/areaEffect_test.go31
1 files changed, 29 insertions, 2 deletions
diff --git a/go/game/areaEffect_test.go b/go/game/areaEffect_test.go
index 0da2c8ac..30bcb760 100644
--- a/go/game/areaEffect_test.go
+++ b/go/game/areaEffect_test.go
@@ -16,8 +16,7 @@ symbols:
m, _ := readMap(r)
s.SetMap(m)
- s.AddNewPlayer("player", NewDeck())
- p := s.Players()[0]
+ p := s.AddNewPlayer("player", NewDeck())
t0_0 := s.Map().TileAt(Position{0, 0})
entered0_0, left0_0 := false, false
@@ -68,3 +67,31 @@ symbols:
sword := newEquipmentFromPath("base/sword", t0_1, p)
s.addPermanent(sword)
}
+
+func TestFarmEffect(t *testing.T) {
+ mapDef := `map: |1-
+ FH
+symbols:
+ F: farm
+ H: house
+`
+ s := NewLocalState()
+ r := strings.NewReader(mapDef)
+ m, _ := readMap(r)
+ s.SetMap(m)
+
+ p := s.AddNewPlayer("player", NewDeck())
+ f := s.addNewUnit(NewCard("misc/farmer"), Position{0, 0}, p)
+ if len(f.FullActions) != 1 {
+ t.Fatal("farmer has no farm fullaction")
+ }
+
+ a := NewMoveAction(f)
+ a.Target().AddSelection(m.TileAt(Position{1, 0}))
+
+ a.resolve(s)
+
+ if len(f.FullActions) != 0 {
+ t.Fatal("farmer still has farm fullaction")
+ }
+}