Test coverage - Almost all of score.c
authorAaron Traas <aaron@traas.org>
Wed, 21 Jun 2017 19:04:41 +0000 (15:04 -0400)
committerAaron Traas <aaron@traas.org>
Wed, 21 Jun 2017 19:04:41 +0000 (15:04 -0400)
tests/cheatresume.chk [new file with mode: 0644]
tests/cheatresume.log [new file with mode: 0644]
tests/cheatsave.testsave [new file with mode: 0644]
tests/illformed.chk
tests/illformed.log

diff --git a/tests/cheatresume.chk b/tests/cheatresume.chk
new file mode 100644 (file)
index 0000000..7e7030c
--- /dev/null
@@ -0,0 +1,31 @@
+
+Welcome to Adventure!!  Would you like instructions?
+
+> n
+
+You are standing at the end of a road before a small brick building.
+Around you is a forest.  A small stream flows out of the building and
+down a gully.
+
+> resume
+Can't open file y, try again.
+
+You're at sw end.
+
+The grate is locked.
+
+> blast
+
+There is a loud explosion, and a twenty-foot hole appears in the far
+wall, burying the dwarves in the rubble.  You march through the hole
+and find yourself in the main office, where a cheering band of
+friendly elves carry the conquering adventurer off into the sunset.
+
+It's a pity you took so long about it.
+
+You scored 1000428 out of a possible 430, using 1 turn.
+
+You just went off my scale!!
+
+To achieve the next higher rating would be a neat trick!
+Congratulations!!
diff --git a/tests/cheatresume.log b/tests/cheatresume.log
new file mode 100644 (file)
index 0000000..a841b8a
--- /dev/null
@@ -0,0 +1,6 @@
+## Resume input from /dev/random, inducing a version mismatch error
+n
+resume
+y
+cheatsave.testsave
+blast
\ No newline at end of file
diff --git a/tests/cheatsave.testsave b/tests/cheatsave.testsave
new file mode 100644 (file)
index 0000000..fcd8f1c
Binary files /dev/null and b/tests/cheatsave.testsave differ
index 2bfc88229af4cfaea730009316c389ba863d2e72..4ee86fd3c62b9658c6e4f31d7b148cf72d2a668a 100644 (file)
@@ -75,6 +75,10 @@ I don't know how.
 
 On what?
 
 
 On what?
 
+> blast food
+
+Blasting requires dynamite.
+
 > suspend food
 
 Huh?
 > suspend food
 
 Huh?
@@ -439,7 +443,7 @@ Okay, "BOO".
 
 > score
 
 
 > score
 
-You have garnered 27 out of a possible 430 points, using 86 turns.
+You have garnered 27 out of a possible 430 points, using 87 turns.
 
 > quit keys
 
 
 > quit keys
 
@@ -453,7 +457,7 @@ Do you really want to quit now?
 
 OK
 
 
 OK
 
-You scored 27 out of a possible 430, using 88 turns.
+You scored 27 out of a possible 430, using 89 turns.
 
 You are obviously a rank amateur.  Better luck next time.
 
 
 You are obviously a rank amateur.  Better luck next time.
 
index 8ac5534b71ae47090ae75bd7c7aef13b19f09fe7..5209992294b1d7635da74d40574a6aaeec28b28b 100644 (file)
@@ -11,6 +11,7 @@ walk food
 score food
 foo food
 brief food
 score food
 foo food
 brief food
+blast food
 suspend food
 resume food
 out
 suspend food
 resume food
 out