Improve test coverage.

This commit is contained in:
Eric S. Raymond 2017-06-16 15:40:46 -04:00
parent 0d373a6b87
commit 851f90cdf7
5 changed files with 19 additions and 9 deletions

View file

@ -644,12 +644,12 @@ int light(token_t verb, token_t obj)
} }
if (obj == URN) { if (obj == URN) {
spk=URN_EMPTY; if (game.prop[URN] == 0) {
if (game.prop[URN] == 0) RSPEAK(URN_EMPTY);
{RSPEAK(spk); return GO_CLEAROBJ;} } else {
spk=URN_LIT;
game.prop[URN] = 2; game.prop[URN] = 2;
RSPEAK(spk); RSPEAK(URN_LIT);
}
return GO_CLEAROBJ; return GO_CLEAROBJ;
} else { } else {
if (obj != LAMP) if (obj != LAMP)

View file

@ -261,6 +261,10 @@ The dragon is sprawled out on a persian rug!!
The little bird attacks the green dragon, and in an astounding flurry The little bird attacks the green dragon, and in an astounding flurry
gets burnt to a cinder. The ashes blow away. gets burnt to a cinder. The ashes blow away.
> extinguish dragon
It is beyond your power to do that.
> kill dragon > kill dragon
With what? Your bare hands? With what? Your bare hands?
@ -276,7 +280,7 @@ A huge green fierce dragon bars the way!
The dragon is sprawled out on a persian rug!! The dragon is sprawled out on a persian rug!!
You scored 77 out of a possible 430, using 47 turns. You scored 77 out of a possible 430, using 48 turns.
Your score qualifies you as a novice class adventurer. Your score qualifies you as a novice class adventurer.

View file

@ -47,5 +47,6 @@ n
sw sw
w w
drop bird drop bird
extinguish dragon
kill dragon kill dragon
n n

View file

@ -167,6 +167,10 @@ Don't be ridiculous!
OK OK
> feed keys
I'm game. Would you care to explain how?
> throw keys > throw keys
OK OK
@ -296,7 +300,7 @@ Okay, "BOO".
> score > score
You have garnered 27 out of a possible 430 points, using 55 turns. You have garnered 27 out of a possible 430 points, using 56 turns.
> quit bottle > quit bottle
@ -310,7 +314,7 @@ Do you really want to quit now?
OK OK
You scored 27 out of a possible 430, using 57 turns. You scored 27 out of a possible 430, using 58 turns.
You are obviously a rank amateur. Better luck next time. You are obviously a rank amateur. Better luck next time.

View file

@ -32,6 +32,7 @@ off keys
break keys break keys
wake keys wake keys
take keys take keys
feed keys
throw keys throw keys
eat food eat food
drink blood drink blood