From 3b0097e9edad37b24ab0e46a45843736fc6db00c Mon Sep 17 00:00:00 2001 From: Wolfgang Faust Date: Tue, 5 Sep 2017 16:56:35 -0400 Subject: [PATCH] Modify tests to support multiple arguments. Also, update tests for --number to actually check that flag. Previously they were checking for a '-n' tag inside an 'li' tag, producing the empty string. I don't think this was the intended result. --- tests/cmds.txt | 4 ++-- tests/expected_output.txt | 4 ++-- tests/run.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cmds.txt b/tests/cmds.txt index beca6c2..c699bfe 100644 --- a/tests/cmds.txt +++ b/tests/cmds.txt @@ -45,5 +45,5 @@ link , a link , a sup link , a:parent-of(sup) link , a:parent-of(sup) sup -li --number -li -n +li --number +li -n diff --git a/tests/expected_output.txt b/tests/expected_output.txt index 3b08cee..e448b66 100644 --- a/tests/expected_output.txt +++ b/tests/expected_output.txt @@ -45,5 +45,5 @@ da39a3ee5e6b4b0d3255bfef95601890afd80709 #toc li > li 0d1f66765d1632c70f8608947890524e78459362 link , a sup b6a3d6cccd305fcc3e8bf2743c443743bdaaa02b link , a:parent-of(sup) 0d1f66765d1632c70f8608947890524e78459362 link , a:parent-of(sup) sup -da39a3ee5e6b4b0d3255bfef95601890afd80709 li --number -da39a3ee5e6b4b0d3255bfef95601890afd80709 li -n +d200756078ef79d77fb17848c5f15b85bcea7e00 li --number +d200756078ef79d77fb17848c5f15b85bcea7e00 li -n diff --git a/tests/run.py b/tests/run.py index 67a13e0..6789e6b 100755 --- a/tests/run.py +++ b/tests/run.py @@ -8,7 +8,7 @@ data = open("index.html", "r").read() for line in open("cmds.txt", "r"): line = line.strip() - p = Popen(['pup', line], stdout=PIPE, stdin=PIPE, stderr=PIPE) + p = Popen(['pup']+line.split('\t'), stdout=PIPE, stdin=PIPE, stderr=PIPE) h = sha1() h.update(p.communicate(input=data)[0]) print("%s %s" % (h.hexdigest(), line))