We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0791585 commit eb2e6cbCopy full SHA for eb2e6cb
tests/test_game.lua
@@ -0,0 +1,16 @@
1
+-- Basic unit test in Lua (run with `lua test_game.lua`)
2
+
3
+require("game")
4
+require("data")
5
6
+-- Test move
7
+player.location = "start"
8
+move("north")
9
+assert(player.location == "cave", "Move north failed")
10
11
+-- Test pickup
12
+player.location = "river"
13
+pickup()
14
+assert(#player.inventory == 1 and player.inventory[1].name == "Shiny Sword", "Pickup failed")
15
16
+print("All tests passed ✅")
0 commit comments