From: Eric S. Raymond Date: Tue, 12 Apr 2022 23:45:43 +0000 (-0400) Subject: Fix bugs in coverage testing. X-Git-Tag: 1.11~25 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=8b8a3a73c4812af90bdd755c35f6c4e001553872;p=open-adventure.git Fix bugs in coverage testing. --- diff --git a/Makefile b/Makefile index c44cce5..f8599ea 100644 --- a/Makefile +++ b/Makefile @@ -64,8 +64,9 @@ cheat: $(CHEAT_OBJS) dungeon.o check: advent cheat cd tests; $(MAKE) --quiet -# After this, run your browser ob coverage/open-adventure/index.html -# to see coverage results. +# After this, run your browser on coverage/open-adventure/index.html +# to see coverage results. Browse coverage/adventure.yaml.html +# to see symbol coverage over the YAML file. coverage: debug cd tests; $(MAKE) coverage --quiet diff --git a/adventure.yaml b/adventure.yaml index 7b40eaf..8190536 100644 --- a/adventure.yaml +++ b/adventure.yaml @@ -2828,7 +2828,6 @@ arbitrary_messages: !!omap black smoke. - SHELL_IMPERVIOUS: 'The shell is very strong and is impervious to attack.' - START_OVER: 'What''s the matter, can''t you read? Now you''d best start over.' -- WELL_POINTLESS: 'Well, that was remarkably pointless.' - DRAGON_SCALES: 'The axe bounces harmlessly off the dragon''s thick scales.' - NASTY_DRAGON: 'The dragon looks rather nasty. You''d best not try to get by.' - BIRD_BURNT: |- diff --git a/tests/coverage_dungeon.py b/tests/coverage_dungeon.py index 46f0b11..182930c 100755 --- a/tests/coverage_dungeon.py +++ b/tests/coverage_dungeon.py @@ -71,10 +71,10 @@ def search(needle, haystack): needle_san = re.escape(needle) \ .replace("\\n", "\n") \ .replace("\\t", "\t") \ - .replace("\%S", ".*") \ - .replace("\%s", ".*") \ - .replace("\%d", ".*") \ - .replace("\%V", ".*") + .replace("%S", ".*") \ + .replace("%s", ".*") \ + .replace("%d", ".*") \ + .replace("%V", ".*") return re.search(needle_san, haystack)