From 99595f6a2a68a0c309b9955c56c2a8d297ecac76 Mon Sep 17 00:00:00 2001 From: Aaron Traas Date: Thu, 13 Jul 2017 15:56:37 -0400 Subject: [PATCH] YAML coverage parser bug fixed -- handling `\n` and `\t` correctly --- tests/coverage_dungeon.py | 2 ++ tests/saveresume.4.chk | 6 +----- tests/saveresume.4.log | 1 - 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/coverage_dungeon.py b/tests/coverage_dungeon.py index a61c6f7..50697fe 100755 --- a/tests/coverage_dungeon.py +++ b/tests/coverage_dungeon.py @@ -44,6 +44,8 @@ def search(needle, haystack): # replacing %s, %d, etc. with regex wildcards, so the variable messages # within the dungeon definition will actually match needle = re.escape(needle) \ + .replace("\\n", "\n") \ + .replace("\\t", "\t") \ .replace("\%S", ".*") \ .replace("\%s", ".*") \ .replace("\%d", ".*") \ diff --git a/tests/saveresume.4.chk b/tests/saveresume.4.chk index 06c3b4b..260cbf3 100644 --- a/tests/saveresume.4.chk +++ b/tests/saveresume.4.chk @@ -14,10 +14,6 @@ You're at sw end. The grate is locked. -> yes - -Guess again. - > blast There is a loud explosion, and a twenty-foot hole appears in the far @@ -25,7 +21,7 @@ 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. -You scored 423 out of a possible 430, using 469 turns. +You scored 423 out of a possible 430, using 468 turns. Your score puts you in Master Adventurer Class A. diff --git a/tests/saveresume.4.log b/tests/saveresume.4.log index d07d342..a2d5901 100644 --- a/tests/saveresume.4.log +++ b/tests/saveresume.4.log @@ -4,5 +4,4 @@ n resume y saveresume_win.adv -yes blast \ No newline at end of file -- 2.31.1