Cover MISSING_BATTERIES in a test. Needs unducumented "waste" fallback.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 17 Jul 2017 10:07:01 +0000 (06:07 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 17 Jul 2017 10:07:01 +0000 (06:07 -0400)
main.c
tests/bigfail.chk
tests/bigfail.log

diff --git a/main.c b/main.c
index bf8927894f218f57085c5c71f1b4cace3beba61c..1c818ccd1e0101a7762ced17e085d261f47a1f9e 100644 (file)
--- a/main.c
+++ b/main.c
@@ -147,6 +147,11 @@ static bool fallback_handler(struct command_t command)
         --game.turns;
         return true;
     }
         --game.turns;
         return true;
     }
+    else if (sscanf(buf, "waste %ld", &sv) == 1) {
+        game.limit -= sv;
+        printf("Game limit is now %ld\n", game.limit);
+        return true;
+    }
     return false;
 }
 
     return false;
 }
 
index fce09de5a7461b9725d807cf84d2244304c8019f..39e17aa04d89749ac0bce7c611db28a154d2cc46 100644 (file)
@@ -2485,8 +2485,32 @@ OK
 
 The wind whistles coldly past your ears.
 
 
 The wind whistles coldly past your ears.
 
+> score
 
 
-You scored 207 out of a possible 430, using 405 turns.
+You have garnered 207 out of a possible 430 points, using 406 turns.
+
+> inven
+
+You are currently holding the following:
+Brass lantern
+Dwarf's axe
+
+> waste 2446
+Game limit is now 31
+
+You're in Hall of Mists.
+
+Rough stone steps lead up the dome.
+
+> z
+
+Your lamp is getting dim, and you're out of spare batteries.  You'd
+best start wrapping this up.
+
+OK
+
+
+You scored 207 out of a possible 430, using 409 turns.
 
 You may now consider yourself a "Seasoned Adventurer".
 
 
 You may now consider yourself a "Seasoned Adventurer".
 
index 384a89014d48459a171210f5572d63fd41988585..98aab41e146d5bc99f555c1cfb18614b4ca5731d 100644 (file)
@@ -432,3 +432,10 @@ s
 e
 take axe
 listen
 e
 take axe
 listen
+# At Hall of Mists
+score
+inven
+# Timewarp forward to test exhaustion of replacement batteries
+waste 2446
+z
+# MISSING_BATTERIES is uttered