Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check the whole page in the extension tests
A page that died part way through, or logged an error, passed as long
as the text grepped for came before the failure. Four tests also read
the page an earlier test had fetched, so none of them could run alone.
Diffstat (limited to 'tests/t0501-about-render.sh')
| -rwxr-xr-x | tests/t0501-about-render.sh | 38 |
1 file changed, 19 insertions, 19 deletions
diff --git a/tests/t0501-about-render.sh b/tests/t0501-about-render.sh index 56f2e77..2cf84ed 100755 --- a/tests/t0501-about-render.sh +++ b/tests/t0501-about-render.sh @@ -83,39 +83,39 @@ then fi test_expect_success CGIT_LUA_LPEG 'the about page renders the markdown' ' - cgit_url "md/about/" >tmp && - grep "<h1 id=.the-title.>The Title</h1>" tmp && - grep "<strong>bold</strong>" tmp + cgit_ok_url "md/about/" >tmp && + test_grep "<h1 id=.the-title.>The Title</h1>" tmp && + test_grep "<strong>bold</strong>" tmp ' test_expect_success CGIT_LUA_LPEG 'readme markup reaches the page escaped' ' - cgit_url "md/about/" >tmp && - grep "<script>alert(1)</script>" tmp && - ! grep "<script>alert(1)" tmp + cgit_ok_url "md/about/" >tmp && + test_grep "<script>alert(1)</script>" tmp && + test_grep ! "<script>alert(1)" tmp ' test_expect_success CGIT_LUA_LPEG 'a relative link leads into the tree' ' - cgit_url "md/about/" >tmp && - grep "<a href=./md/tree/ROADMAP.md#plan.>roadmap</a>" tmp + cgit_ok_url "md/about/" >tmp && + test_grep "<a href=./md/tree/ROADMAP.md#plan.>roadmap</a>" tmp ' test_expect_success CGIT_LUA_LPEG 'the link stays on the branch shown' ' - cgit_url "md/about/&h=next" >tmp && - grep "<a href=./md/tree/ROADMAP.md?h=next#plan.>roadmap</a>" tmp + cgit_ok_url "md/about/&h=next" >tmp && + test_grep "<a href=./md/tree/ROADMAP.md?h=next#plan.>roadmap</a>" tmp ' test_expect_success CGIT_LUA_LPEG 'the about page renders a man page' ' - cgit_url "man/about/" >tmp && - grep "<div class=.markdown.><h2 id=.name.>NAME</h2>" tmp && - grep "tool - does one thing — well" tmp && - grep "<strong>-v</strong><br>" tmp && - grep "<pre><code>tool -v <file>" tmp && - ! grep "\\\\f" tmp + cgit_ok_url "man/about/" >tmp && + test_grep "<div class=.markdown.><h2 id=.name.>NAME</h2>" tmp && + test_grep "tool - does one thing — well" tmp && + test_grep "<strong>-v</strong><br>" tmp && + test_grep "<pre><code>tool -v <file>" tmp && + test_grep ! "\\\\f" tmp ' -test_expect_success CGIT_LUA 'the about page shows plain text as it is' ' - cgit_url "txt/about/" >tmp && - grep "<pre class=.plaintext.>Plain <b>notes</b> & more" tmp +test_expect_success CGIT_LUA_LPEG 'the about page shows plain text as it is' ' + cgit_ok_url "txt/about/" >tmp && + test_grep "<pre class=.plaintext.>Plain <b>notes</b> & more" tmp ' test_expect_success CGIT_LUA_NOLPEG 'without lpeg the readme is served escaped' ' |
