From 236abc8cab5a6f8d0b1d1921800a8645dcda98a2 Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Wed, 21 Jun 2017 15:04:41 -0400 Subject: [PATCH] Test coverage - Almost all of score.c --- tests/cheatresume.chk | 31 +++++++++++++++++++++++++++++++ tests/cheatresume.log | 6 ++++++ tests/cheatsave.testsave | Bin 0 -> 7688 bytes tests/illformed.chk | 8 ++++++-- tests/illformed.log | 1 + 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 tests/cheatresume.chk create mode 100644 tests/cheatresume.log create mode 100644 tests/cheatsave.testsave diff --git a/tests/cheatresume.chk b/tests/cheatresume.chk new file mode 100644 index 0000000..7e7030c --- /dev/null +++ b/tests/cheatresume.chk @@ -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 index 0000000..a841b8a --- /dev/null +++ b/tests/cheatresume.log @@ -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 index 0000000000000000000000000000000000000000..fcd8f1c8fdb31c34923ec7a59db9acdac7de1af5 GIT binary patch literal 7688 zcmeI%$!b(V6vpuz=OKE8V7JLfy+R#m5O-|BpR_33dl{u+zdre9+GH9W7)_oH*$gJxxm zL*Ev(I6tBTL3j{@x4|#b_j|Azh>AsRgL+qq%WC%r`6bL-{81#3Z{+EZmi1vF&sXD| zf??g)!POH}?Okdb{!CtRI@7xB4?oH;PKEsP%Thkecsn}trTO&JM_=SaJ{tYq(3szM z*V7-ZTV0Ln__8j=OV<%c_2_-K9va21PaWoX)_hZCY2NyoAC2nre8kcI@`>Z&Xvn93 z_RFio_FbrHgCmybdIZ6H(9Dj^>n_Te7ER2lkKMt)tfKM|1I@F zb^3{Sntzf*hsx|X2>L!<5_((8lUogfuanMlR|KZ}{^7bi4SJmKdVGDg z&R6xTGNS4ZLqyk zw!4zAr7tAI#-vH-B=@;vkvI}O!5BOn91fldo(sC}(a@)Y?kDF%UkqLf9uHm(y5F7- z-N)?Mfe*3FH?w28{Z)2p2b@3h@5G*K#Bq6CSN?j^;_ml1(meIK9dSC@np#}m_uJiQ zup>1ZP5Mdb);|Fz$e?nEf@apU)SasgM1T&sx0C|6>Q-m%aZ# E0r$a0_5c6? literal 0 HcmV?d00001 diff --git a/tests/illformed.chk b/tests/illformed.chk index 2bfc882..4ee86fd 100644 --- a/tests/illformed.chk +++ b/tests/illformed.chk @@ -75,6 +75,10 @@ I don't know how. On what? +> blast food + +Blasting requires dynamite. + > suspend food Huh? @@ -439,7 +443,7 @@ Okay, "BOO". > 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 @@ -453,7 +457,7 @@ Do you really want to quit now? 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. diff --git a/tests/illformed.log b/tests/illformed.log index 8ac5534..5209992 100644 --- a/tests/illformed.log +++ b/tests/illformed.log @@ -11,6 +11,7 @@ walk food score food foo food brief food +blast food suspend food resume food out -- 2.31.1