From: Eric S. Raymond Date: Mon, 17 Jul 2017 10:07:01 +0000 (-0400) Subject: Cover MISSING_BATTERIES in a test. Needs unducumented "waste" fallback. X-Git-Tag: 1.3~66 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=992bdbf16cb230462865b31cc9004475e6ac9e86;p=open-adventure.git Cover MISSING_BATTERIES in a test. Needs unducumented "waste" fallback. --- diff --git a/main.c b/main.c index bf89278..1c818cc 100644 --- a/main.c +++ b/main.c @@ -147,6 +147,11 @@ static bool fallback_handler(struct command_t command) --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; } diff --git a/tests/bigfail.chk b/tests/bigfail.chk index fce09de..39e17aa 100644 --- a/tests/bigfail.chk +++ b/tests/bigfail.chk @@ -2485,8 +2485,32 @@ OK 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". diff --git a/tests/bigfail.log b/tests/bigfail.log index 384a890..98aab41 100644 --- a/tests/bigfail.log +++ b/tests/bigfail.log @@ -432,3 +432,10 @@ s 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