projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0d373a6
)
Improve test coverage.
author
Eric S. Raymond
<esr@thyrsus.com>
Fri, 16 Jun 2017 19:40:46 +0000
(15:40 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Fri, 16 Jun 2017 19:40:46 +0000
(15:40 -0400)
actions.c
patch
|
blob
|
history
tests/barehands.chk
patch
|
blob
|
history
tests/barehands.log
patch
|
blob
|
history
tests/illformed.chk
patch
|
blob
|
history
tests/illformed.log
patch
|
blob
|
history
diff --git
a/actions.c
b/actions.c
index 0e56f254beeffa6e227e2ee8a557b8dc69ca9881..9b09183bc5e115cdb27e41e6d151c54e9a26c75e 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-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)
- {RSPEAK(spk); return GO_CLEAROBJ;}
-
spk=URN_LIT
;
-
game.prop[URN]=2
;
- RSPEAK(spk);
+ if (game.prop[URN] == 0) {
+ RSPEAK(URN_EMPTY);
+ } else {
+
game.prop[URN] = 2
;
+
RSPEAK(URN_LIT)
;
+ }
return GO_CLEAROBJ;
} else {
if (obj != LAMP)
return GO_CLEAROBJ;
} else {
if (obj != LAMP)
diff --git
a/tests/barehands.chk
b/tests/barehands.chk
index 91337dab5c44ca674fe51ded82a25d7cb6ab3d95..c39f4503640ade2dc496436adca509b9ded8367f 100644
(file)
--- a/
tests/barehands.chk
+++ b/
tests/barehands.chk
@@
-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
gets burnt to a cinder. The ashes blow away.
The little bird attacks the green dragon, and in an astounding flurry
gets burnt to a cinder. The ashes blow away.
+> extinguish dragon
+
+It is beyond your power to do that.
+
> kill dragon
With what? Your bare hands?
> kill dragon
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 4
7
turns.
+You scored 77 out of a possible 430, using 4
8
turns.
Your score qualifies you as a novice class adventurer.
Your score qualifies you as a novice class adventurer.
diff --git
a/tests/barehands.log
b/tests/barehands.log
index d4a5751c1dd567e9fd46f0ff806e833f094dd477..81bc521acd358fd618d8af045d31edd1a12197a6 100644
(file)
--- a/
tests/barehands.log
+++ b/
tests/barehands.log
@@
-47,5
+47,6
@@
n
sw
w
drop bird
sw
w
drop bird
+extinguish dragon
kill dragon
n
kill dragon
n
diff --git
a/tests/illformed.chk
b/tests/illformed.chk
index 3730e9f65f2bf2c96ed024529b8f37c8a03f3510..26775073cc86734daa51b352774a4c705ab18430 100644
(file)
--- a/
tests/illformed.chk
+++ b/
tests/illformed.chk
@@
-167,6
+167,10
@@
Don't be ridiculous!
OK
OK
+> feed keys
+
+I'm game. Would you care to explain how?
+
> throw keys
OK
> throw keys
OK
@@
-296,7
+300,7
@@
Okay, "BOO".
> score
> score
-You have garnered 27 out of a possible 430 points, using 5
5
turns.
+You have garnered 27 out of a possible 430 points, using 5
6
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 5
7
turns.
+You scored 27 out of a possible 430, using 5
8
turns.
You are obviously a rank amateur. Better luck next time.
You are obviously a rank amateur. Better luck next time.
diff --git
a/tests/illformed.log
b/tests/illformed.log
index 31c1669d60df5cf3d6bb3afaa5433d254863e88a..6bc8ac63fc23367a291b59f54a74b672e58f080f 100644
(file)
--- a/
tests/illformed.log
+++ b/
tests/illformed.log
@@
-32,6
+32,7
@@
off keys
break keys
wake keys
take keys
break keys
wake keys
take keys
+feed keys
throw keys
eat food
drink blood
throw keys
eat food
drink blood