diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Clean up the whole tree
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/extensions/harness.lua | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/lib.sh | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/test-about-render.lua | 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/test-auth.lua | 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/test-email-avatar.lua | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/test-link-commits.lua | 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rw-r--r-- | tests/extensions/test-syntax-highlight.lua | 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0002-html-validity.sh | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0003-cache.sh | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0004-docs.sh | 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0104-tree.sh | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0109-patch.sh | 15 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0301-security.sh | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0501-about-render.sh | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0503-link-commits.sh | 3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0504-email-avatar.sh | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -rwxr-xr-x | tests/t0505-auth.sh | 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17 files changed, 106 insertions, 212 deletions
diff --git a/tests/extensions/harness.lua b/tests/extensions/harness.lua index d0299e3..d9318ee 100644 --- a/tests/extensions/harness.lua +++ b/tests/extensions/harness.lua @@ -198,8 +198,7 @@ function harness.stub_auth_modules() new = function(key, algorithm) return { final = function(self, payload) - return fake_digest_bytes(key .. "\1" .. - algorithm .. "\1" .. payload) + return fake_digest_bytes(key .. "\1" .. algorithm .. "\1" .. payload) end, } end, @@ -227,26 +226,21 @@ end function harness.equals(name, got, want) checks = checks + 1 if got ~= want then - fail(name, "wanted " .. tostring(want) .. - "\n got " .. tostring(got)) + fail(name, "wanted " .. tostring(want) .. "\n got " .. tostring(got)) end end function harness.contains(name, haystack, needle) checks = checks + 1 - if type(haystack) ~= "string" - or not haystack:find(needle, 1, true) then - fail(name, "wanted " .. needle .. - "\nwithin " .. tostring(haystack)) + if type(haystack) ~= "string" or not haystack:find(needle, 1, true) then + fail(name, "wanted " .. needle .. "\nwithin " .. tostring(haystack)) end end function harness.excludes(name, haystack, needle) checks = checks + 1 - if type(haystack) ~= "string" - or haystack:find(needle, 1, true) then - fail(name, "did not want " .. needle .. - "\nwithin " .. tostring(haystack)) + if type(haystack) ~= "string" or haystack:find(needle, 1, true) then + fail(name, "did not want " .. needle .. "\nwithin " .. tostring(haystack)) end end diff --git a/tests/extensions/lib.sh b/tests/extensions/lib.sh index f472faf..26fcbec 100644 --- a/tests/extensions/lib.sh +++ b/tests/extensions/lib.sh @@ -64,6 +64,5 @@ repo.url=lua-probe repo.path=$cgit_lua_probe_gitdir repo.commit-filter=lua:$PWD/lua-probe.lua EOF - CGIT_CONFIG="$PWD/lua-probe-cgitrc" QUERY_STRING="url=lua-probe/commit/" \ - cgit | grep -q LUA_PROBE_YES + CGIT_CONFIG="$PWD/lua-probe-cgitrc" QUERY_STRING="url=lua-probe/commit/" cgit | grep -q LUA_PROBE_YES } diff --git a/tests/extensions/test-about-render.lua b/tests/extensions/test-about-render.lua index aa7e6ad..338949a 100644 --- a/tests/extensions/test-about-render.lua +++ b/tests/extensions/test-about-render.lua @@ -37,8 +37,7 @@ h.contains("no extension renders as plain text", out, h.equals("close answers zero", ret, 0) out = render("notes.txt", "just text") -h.contains("an unknown extension renders as plain text", out, - "<pre class='plaintext'>just text</pre>") +h.contains("an unknown extension renders as plain text", out, "<pre class='plaintext'>just text</pre>") out = render(nil, "no name at all") h.contains("a missing filename renders as plain text", out, @@ -56,11 +55,9 @@ h.contains("writes are joined before rendering", out, "two writes") if mode == "nolpeg" then out = render("README.md", "# Title") - h.contains("markdown without lpeg falls back to plain text", out, - "<pre class='plaintext'># Title</pre>") + h.contains("markdown without lpeg falls back to plain text", out, "<pre class='plaintext'># Title</pre>") out = render("page.1", ".SH NAME") - h.contains("man without lpeg falls back to plain text", out, - "<pre class='plaintext'>.SH NAME</pre>") + h.contains("man without lpeg falls back to plain text", out, "<pre class='plaintext'>.SH NAME</pre>") h.finish() end @@ -71,27 +68,22 @@ end -- Markdown. out = render("README.md", "# Title") -h.contains("a heading renders inside the wrapper", - out, "<div class='markdown'><h1>Title</h1></div>") +h.contains("a heading renders inside the wrapper", out, "<div class='markdown'><h1>Title</h1></div>") out = render("README.md", "## Sub ##") -h.contains("trailing hashes are stripped from a heading", out, - "<h2>Sub</h2>") +h.contains("trailing hashes are stripped from a heading", out, "<h2>Sub</h2>") out = render("README.MD", "# Upper") h.contains("the extension matches whatever its case", out, "<h1>Upper</h1>") out = render("readme.markdown", "# Long") -h.contains("the long markdown extension dispatches too", out, - "<h1>Long</h1>") +h.contains("the long markdown extension dispatches too", out, "<h1>Long</h1>") out = render("README.md", "line one\nline two") -h.contains("a paragraph keeps its line break", out, - "<p>line one<br>line two</p>") +h.contains("a paragraph keeps its line break", out, "<p>line one<br>line two</p>") out = render("README.md", "first para\r\nsecond line") -h.contains("crlf line endings are normalised", out, - "<p>first para<br>second line</p>") +h.contains("crlf line endings are normalised", out, "<p>first para<br>second line</p>") out = render("README.md", "a **bold** and *leaning* word") h.contains("double stars embolden", out, "<strong>bold</strong>") @@ -105,21 +97,17 @@ out = render("README.md", "run `x < y` here") h.contains("inline code is escaped", out, "<code>x < y</code>") out = render("README.md", "raw <script>alert(1)</script> here") -h.contains("markup in text reaches the page escaped", out, - "<script>alert(1)</script>") +h.contains("markup in text reaches the page escaped", out, "<script>alert(1)</script>") h.excludes("no live tag slips through", out, "<script>") out = render("README.md", "[docs](https://example.com/docs)") -h.contains("an https link renders as an anchor", out, - "<a href='https://example.com/docs'>docs</a>") +h.contains("an https link renders as an anchor", out, "<a href='https://example.com/docs'>docs</a>") out = render("README.md", "[docs](docs/page.html)") -h.contains("a relative link renders as an anchor", out, - "<a href='docs/page.html'>docs</a>") +h.contains("a relative link renders as an anchor", out, "<a href='docs/page.html'>docs</a>") out = render("README.md", "[mail](mailto:a@example.com)") -h.contains("a mailto link renders as an anchor", out, - "<a href='mailto:a@example.com'>mail</a>") +h.contains("a mailto link renders as an anchor", out, "<a href='mailto:a@example.com'>mail</a>") out = render("README.md", "[bad](javascript:alert(1))") h.excludes("a javascript link renders no anchor", out, "<a ") @@ -132,8 +120,7 @@ out = render("README.md", "[bad](//evil.example/x)") h.excludes("a scheme relative link renders no anchor", out, "<a ") out = render("README.md", "[q](https://example.com/a'b)") -h.contains("a quote in a link target is escaped", out, - "href='https://example.com/a'b'") +h.contains("a quote in a link target is escaped", out, "href='https://example.com/a'b'") out = render("README.md", "") h.contains("an image renders with its alt text escaped", out, @@ -149,8 +136,7 @@ h.contains("a fenced block carries its language", out, h.contains("text after the fence renders on", out, "<p>after</p>") out = render("README.md", "~~~\n**not bold**\n~~~") -h.contains("no inline parsing happens inside a fence", out, - "<code>**not bold**\n</code>") +h.contains("no inline parsing happens inside a fence", out, "<code>**not bold**\n</code>") out = render("README.md", "---") h.contains("a rule of dashes renders a break", out, "<hr>") @@ -159,12 +145,10 @@ out = render("README.md", "- - -") h.contains("a spaced rule renders a break too", out, "<hr>") out = render("README.md", "> quoted words") -h.contains("a quote renders as a blockquote", out, - "<blockquote><p>quoted words</p></blockquote>") +h.contains("a quote renders as a blockquote", out, "<blockquote><p>quoted words</p></blockquote>") out = render("README.md", "> > deep") -h.contains("quotes nest", out, - "<blockquote><blockquote><p>deep</p></blockquote></blockquote>") +h.contains("quotes nest", out, "<blockquote><blockquote><p>deep</p></blockquote></blockquote>") -- A hostile readme of stacked markers has to hit the depth ceiling instead -- of the interpreter's stack. @@ -177,60 +161,49 @@ out = render("README.md", string.rep("*a", 200)) h.check("an emphasis bomb still renders something", #out > 0) out = render("README.md", "| a | b |\n| --- | --- |\n| 1 | 2 |") -h.contains("a pipe table renders its head", - out, "<thead><tr><th>a</th><th>b</th></tr></thead>") -h.contains("a pipe table renders its body", - out, "<tbody><tr><td>1</td><td>2</td></tr></tbody>") +h.contains("a pipe table renders its head", out, "<thead><tr><th>a</th><th>b</th></tr></thead>") +h.contains("a pipe table renders its body", out, "<tbody><tr><td>1</td><td>2</td></tr></tbody>") out = render("README.md", "a | b in prose") h.excludes("a pipe without a delimiter row stays prose", out, "<table") out = render("README.md", "- first\n- second") -h.contains("dashes render an unordered list", out, - "<ul><li>first</li><li>second</li></ul>") +h.contains("dashes render an unordered list", out, "<ul><li>first</li><li>second</li></ul>") out = render("README.md", "1. first\n2. second") -h.contains("numbers render an ordered list", out, - "<ol><li>first</li><li>second</li></ol>") +h.contains("numbers render an ordered list", out, "<ol><li>first</li><li>second</li></ol>") out = render("README.md", "- plain\n1. numbered") h.contains("a change of marker splits the list", out, "</ul><ol>") out = render("README.md", "- a **bold** item") -h.contains("list items parse their text", out, - "<li>a <strong>bold</strong> item</li>") +h.contains("list items parse their text", out, "<li>a <strong>bold</strong> item</li>") out = render("README.md", string.rep("a", 512 * 1024 + 1)) -h.contains("an oversized readme renders as plain text", out, - "<pre class='plaintext'>") +h.contains("an oversized readme renders as plain text", out, "<pre class='plaintext'>") -- Man pages. out = render("page.1", ".SH NAME") -h.contains("a section heading renders", out, - "<div class='markdown manpage'><h2>NAME</h2></div>") +h.contains("a section heading renders", out, "<div class='markdown manpage'><h2>NAME</h2></div>") out = render("page.man", '.SH "TWO WORDS"') -h.contains("a quoted heading argument is unquoted", out, - "<h2>TWO WORDS</h2>") +h.contains("a quoted heading argument is unquoted", out, "<h2>TWO WORDS</h2>") out = render("page.3", ".SS Details") h.contains("a subsection renders one level down", out, "<h3>Details</h3>") out = render("page.1", ".B bold words\nplain after") -h.contains("the bold macro renders strong", out, - "<p><strong>bold words</strong><br>plain after</p>") +h.contains("the bold macro renders strong", out, "<p><strong>bold words</strong><br>plain after</p>") out = render("page.1", "a \\fBbold\\fR c") -h.contains("font escapes carry across a run", out, - "<p>a <strong>bold</strong> c</p>") +h.contains("font escapes carry across a run", out, "<p>a <strong>bold</strong> c</p>") out = render("page.1", "x \\(em y \\- z") h.contains("character escapes are translated", out, "<p>x - y - z</p>") out = render("page.1", ".nf\ncode <x>\n.fi\nafter") -h.contains("a no fill block renders as code", out, - "<pre><code>code <x>\n</code></pre>") +h.contains("a no fill block renders as code", out, "<pre><code>code <x>\n</code></pre>") h.contains("filling resumes after it", out, "<p>after</p>") out = render("page.1", '.\\" a comment\nvisible') @@ -238,8 +211,7 @@ h.excludes("a roff comment is dropped", out, "comment") h.contains("the line after it renders", out, "visible") out = render("page.1", "first\n\nsecond") -h.contains("a blank line splits paragraphs", out, - "<p>first</p><p>second</p>") +h.contains("a blank line splits paragraphs", out, "<p>first</p><p>second</p>") out = render("page.1", ".TH title 1\nbody") h.excludes("the title macro renders nothing itself", out, "title 1") diff --git a/tests/extensions/test-auth.lua b/tests/extensions/test-auth.lua index 359f52e..e9fed78 100644 --- a/tests/extensions/test-auth.lua +++ b/tests/extensions/test-auth.lua @@ -79,16 +79,14 @@ local userset = repo_userset("secret-repo") h.check("a protected repository lists its users", userset ~= nil and userset.alice and userset.bob) h.equals("an unlisted repository is public", repo_userset("unlisted"), nil) -h.equals("the repository name matches case exactly", - repo_userset("Secret-Repo"), nil) +h.equals("the repository name matches case exactly", repo_userset("Secret-Repo"), nil) local empty = repo_userset("empty-repo") h.check("a protected repository with no members denies as an empty set", empty ~= nil and next(empty) == nil) if variant == "file" then h.redirect_file("/etc/cgit-auth/users", "auth-users-missing") - h.equals("a missing users file turns every login down", - account_hash("alice"), nil) + h.equals("a missing users file turns every login down", account_hash("alice"), nil) h.redirect_file("/etc/cgit-auth/users", "auth-users") end @@ -106,13 +104,10 @@ h.equals("a value is decoded", params.x, "A") h.equals("a cookie is found among others", get_cookie("foo=1; cgitauth=abc; bar=2", "cgitauth"), "abc") -h.equals("a lone cookie is found", get_cookie("cgitauth=abc", "cgitauth"), - "abc") +h.equals("a lone cookie is found", get_cookie("cgitauth=abc", "cgitauth"), "abc") h.equals("no header yields no cookie", get_cookie(nil, "cgitauth"), nil) -h.equals("a longer name does not match", - get_cookie("xcgitauth=z", "cgitauth"), nil) -h.equals("a magic character in the name is taken literally", - get_cookie("a-b=z", "a-b"), "z") +h.equals("a longer name does not match", get_cookie("xcgitauth=z", "cgitauth"), nil) +h.equals("a magic character in the name is taken literally", get_cookie("a-b=z", "a-b"), "z") h.check("equal strings compare equal", constant_equals("abc", "abc")) h.check("differing strings do not", not constant_equals("abc", "abd")) @@ -124,53 +119,42 @@ h.check("a scheme relative target is not", not is_safe_redirect("//evil")) h.check("a backslash variant is not", not is_safe_redirect("/\\evil")) h.check("a missing target is not", not is_safe_redirect(nil)) -h.equals("control characters are stripped from header values", - strip_controls("a\r\nb"), "ab") +h.equals("control characters are stripped from header values", strip_controls("a\r\nb"), "ab") -- Signing and verification. local now = os.time() local cookie = secure_value("username", "alice", now + 3600) -h.equals("a signed value verifies and comes back", - validate_value("username", cookie), "alice") +h.equals("a signed value verifies and comes back", validate_value("username", cookie), "alice") cookie = secure_value("username", "a|b", now + 3600) -h.equals("a value holding the separator survives the round trip", - validate_value("username", cookie), "a|b") +h.equals("a value holding the separator survives the round trip", validate_value("username", cookie), "a|b") cookie = secure_value("username", "a\nb", now + 3600) h.equals("a signed control character is still rejected on the way out", validate_value("username", cookie), nil) cookie = secure_value("redirect", "/repo/?a=b", 0) -h.equals("an expiration of zero never expires", - validate_value("redirect", cookie), "/repo/?a=b") +h.equals("an expiration of zero never expires", validate_value("redirect", cookie), "/repo/?a=b") cookie = secure_value("username", "alice", now - 10) -h.equals("an expired value is rejected", - validate_value("username", cookie), nil) +h.equals("an expired value is rejected", validate_value("username", cookie), nil) cookie = secure_value("username", "alice", now + 3600) -local flipped = cookie:sub(1, -2) .. - (cookie:sub(-1) == "0" and "1" or "0") -h.equals("a tampered signature is rejected", - validate_value("username", flipped), nil) +local flipped = cookie:sub(1, -2) .. (cookie:sub(-1) == "0" and "1" or "0") +h.equals("a tampered signature is rejected", validate_value("username", flipped), nil) -h.equals("a value signed for one field does not serve another", - validate_value("redirect", cookie), nil) +h.equals("a value signed for one field does not serve another", validate_value("redirect", cookie), nil) h.equals("no cookie does not verify", validate_value("username", nil), nil) -h.equals("a tiny cookie does not verify", validate_value("username", "ab"), - nil) -h.equals("a leading separator does not verify", - validate_value("username", "|x|1|s|sig"), nil) +h.equals("a tiny cookie does not verify", validate_value("username", "ab"), nil) +h.equals("a leading separator does not verify", validate_value("username", "|x|1|s|sig"), nil) h.equals("an unsigned cookie does not verify", validate_value("username", "username|alice|123|salt"), nil) h.equals("an exponent spelling of the expiry does not verify", validate_value("username", "username|alice|1e9|salt|beef"), nil) -h.equals("an empty value signs to nothing", secure_value("username", "", 1), - "") +h.equals("an empty value signs to nothing", secure_value("username", "", 1), "") -- The headers the filter writes itself. @@ -220,34 +204,27 @@ out, ret = run_action("authenticate-cookie", { repo = "secret-repo" }) h.equals("a protected repository turns a bare request away", ret, 0) local session = secure_value("username", "Alice", now + 3600) -out, ret = run_action("authenticate-cookie", - { repo = "secret-repo", cookie = "cgitauth=" .. session }) +out, ret = run_action("authenticate-cookie", { repo = "secret-repo", cookie = "cgitauth=" .. session }) h.equals("a signed session for a member is let through", ret, 1) -out, ret = run_action("authenticate-cookie", - { repo = "empty-repo", cookie = "cgitauth=" .. session }) +out, ret = run_action("authenticate-cookie", { repo = "empty-repo", cookie = "cgitauth=" .. session }) h.equals("a memberless repository denies even a valid session", ret, 0) local outsider = secure_value("username", "carol", now + 3600) -out, ret = run_action("authenticate-cookie", - { repo = "secret-repo", cookie = "cgitauth=" .. outsider }) +out, ret = run_action("authenticate-cookie", { repo = "secret-repo", cookie = "cgitauth=" .. outsider }) h.equals("a signed session for an outsider is turned away", ret, 0) -local forged = session:sub(1, -2) .. - (session:sub(-1) == "0" and "1" or "0") -out, ret = run_action("authenticate-cookie", - { repo = "secret-repo", cookie = "cgitauth=" .. forged }) +local forged = session:sub(1, -2) .. (session:sub(-1) == "0" and "1" or "0") +out, ret = run_action("authenticate-cookie", { repo = "secret-repo", cookie = "cgitauth=" .. forged }) h.equals("a forged session is turned away", ret, 0) out, ret = run_action("no-such-action", {}) h.equals("an unknown action denies rather than raising", ret, 0) out, ret = run_action("body", { url = "/repo/log/?q=x" }) -h.contains("the login form posts to the login url", out, - "<form method='post' action='/?p=login'>") +h.contains("the login form posts to the login url", out, "<form method='post' action='/?p=login'>") local token = out:match("name='redirect' value='([^']*)'") -h.equals("the form carries a signed way back", - token and validate_value("redirect", token), "/repo/log/?q=x") +h.equals("the form carries a signed way back", token and validate_value("redirect", token), "/repo/log/?q=x") out, ret = run_action("body", { url = "//evil.example/x" }) token = out:match("name='redirect' value='([^']*)'") @@ -258,45 +235,37 @@ local way_back = secure_value("redirect", "/repo/", 0) out, ret = run_action("authenticate-post", { method = "POST", - body = "username=Alice&password=" .. url_encode(password) .. - "&redirect=" .. url_encode(way_back), + body = "username=Alice&password=" .. url_encode(password) .. "&redirect=" .. url_encode(way_back), }) h.contains("a good login redirects back", out, "Status: 302") h.contains("to where the form said", out, "Location: /repo/\n") local granted = out:match("Set%-Cookie: cgitauth=([^;]*);") -h.equals("and grants a session that verifies", - granted and validate_value("username", granted), "Alice") +h.equals("and grants a session that verifies", granted and validate_value("username", granted), "Alice") out, ret = run_action("authenticate-post", { method = "POST", - body = "username=Alice&password=wrong&redirect=" .. - url_encode(way_back), + body = "username=Alice&password=wrong&redirect=" .. url_encode(way_back), }) h.contains("a bad password redirects the same way", out, "Status: 302") -h.contains("but clears the session cookie", out, - "Set-Cookie: cgitauth=; ") +h.contains("but clears the session cookie", out, "Set-Cookie: cgitauth=; ") out, ret = run_action("authenticate-post", { method = "POST", body = "username=nobody&password=x&redirect=" .. url_encode(way_back), }) -h.contains("an unknown user is told nothing different", out, - "Set-Cookie: cgitauth=; ") +h.contains("an unknown user is told nothing different", out, "Set-Cookie: cgitauth=; ") out, ret = run_action("authenticate-post", { method = "POST", body = "username=Alice&password=" .. url_encode(password), }) -h.contains("a post without the signed token is not served", out, - "Status: 404") +h.contains("a post without the signed token is not served", out, "Status: 404") local hijack = secure_value("redirect", "//evil.example/", 0) out, ret = run_action("authenticate-post", { method = "POST", - body = "username=Alice&password=" .. url_encode(password) .. - "&redirect=" .. url_encode(hijack), + body = "username=Alice&password=" .. url_encode(password) .. "&redirect=" .. url_encode(hijack), }) -h.contains("even a signed unsafe destination is not followed", out, - "Status: 404") +h.contains("even a signed unsafe destination is not followed", out, "Status: 404") h.finish() diff --git a/tests/extensions/test-email-avatar.lua b/tests/extensions/test-email-avatar.lua index d6bd957..94fec7e 100644 --- a/tests/extensions/test-email-avatar.lua +++ b/tests/extensions/test-email-avatar.lua @@ -70,8 +70,7 @@ h.contains("the name is buffered across writes", out, "> A U Thor") if mode == "real" then out = render("test@example.com", "x") - h.equals("a known address hashes to its published md5", - hash_of(out), "55502f40dc8b7c769880b10874abc9d0") + h.equals("a known address hashes to its published md5", hash_of(out), "55502f40dc8b7c769880b10874abc9d0") end h.finish() diff --git a/tests/extensions/test-link-commits.lua b/tests/extensions/test-link-commits.lua index 6c6d28d..07b2fdb 100644 --- a/tests/extensions/test-link-commits.lua +++ b/tests/extensions/test-link-commits.lua @@ -15,22 +15,19 @@ local function render(text) end local out, ret = render("see #123 for details") -h.contains("issue mark becomes a link", out, - "<a href='https://bugs.example.com/?bug=123'>#123</a>") +h.contains("issue mark becomes a link", out, "<a href='https://bugs.example.com/?bug=123'>#123</a>") h.contains("text around the link survives", out, "see ") h.contains("text after the link survives", out, " for details") h.equals("close answers zero", ret, 0) out = render("fixed in deadbee") -h.contains("seven hex characters link", out, - "<a href='./?id=deadbee'>deadbee</a>") +h.contains("seven hex characters link", out, "<a href='./?id=deadbee'>deadbee</a>") out = render("fixed in deadbe") h.excludes("six hex characters stay text", out, "<a") out = render("fixed in 1234567") -h.contains("an all digit run still links", out, - "<a href='./?id=1234567'>1234567</a>") +h.contains("an all digit run still links", out, "<a href='./?id=1234567'>1234567</a>") local sha1 = string.rep("0123456789abcdef", 2) .. "01234567" out = render("commit " .. sha1) @@ -58,14 +55,12 @@ h.excludes("the overlapped hash is dropped", out, "./?id=") out = render("#12 and cafebabe12") h.contains("both rules fire on one message", out, "?bug=12'>#12</a>") -h.contains("the object link also fires", out, - "<a href='./?id=cafebabe12'>cafebabe12</a>") +h.contains("the object link also fires", out, "<a href='./?id=cafebabe12'>cafebabe12</a>") -- One request is delivered as several writes, and a match split across two of -- them has to be seen whole. out = h.run({}, { "see #45", "6 and be done" }) -h.contains("a match split across writes still links", out, - "?bug=456'>#456</a>") +h.contains("a match split across writes still links", out, "?bug=456'>#456</a>") out, ret = render("") h.equals("an empty message stays empty", out, "") diff --git a/tests/extensions/test-syntax-highlight.lua b/tests/extensions/test-syntax-highlight.lua index 3b0eeb8..a9e8b36 100644 --- a/tests/extensions/test-syntax-highlight.lua +++ b/tests/extensions/test-syntax-highlight.lua @@ -31,51 +31,40 @@ if mode == "nolexers" then -- put the line numbers beside it out of step, so the whole escaped -- blob has to come back intact across several slices. out = render("big.fake", string.rep("x<y>", 30000)) - h.equals("slicing loses nothing at the boundaries", out, - string.rep("x<y>", 30000)) + h.equals("slicing loses nothing at the boundaries", out, string.rep("x<y>", 30000)) h.finish() end local out, ret = render("hello.fake", "if 42 'hi' & zz") -h.contains("keywords are wrapped in their class", out, - "<span class='hl-keyword'>if</span>") -h.contains("numbers are wrapped in their class", out, - "<span class='hl-number'>42</span>") -h.contains("a dotted tag maps by its first component", out, - "<span class='hl-string'>'hi'</span>") +h.contains("keywords are wrapped in their class", out, "<span class='hl-keyword'>if</span>") +h.contains("numbers are wrapped in their class", out, "<span class='hl-number'>42</span>") +h.contains("a dotted tag maps by its first component", out, "<span class='hl-string'>'hi'</span>") h.contains("bytes between tokens are escaped", out, " & ") -h.contains("later tokens still highlight", out, - "<span class='hl-keyword'>zz</span>") +h.contains("later tokens still highlight", out, "<span class='hl-keyword'>zz</span>") h.equals("close answers zero", ret, 0) out = h.run({ "split.fake" }, { "i", "f" }) -h.equals("writes are joined before lexing", out, - "<span class='hl-keyword'>if</span>") +h.equals("writes are joined before lexing", out, "<span class='hl-keyword'>if</span>") -- The short lexer tags four bytes and stops, and every byte after it still -- has to reach the page. out = render("cut.short", "abcd<ef>") -h.equals("a lexer stopping early leaves an escaped tail", out, - "<span class='hl-keyword'>abcd</span><ef>") +h.equals("a lexer stopping early leaves an escaped tail", out, "<span class='hl-keyword'>abcd</span><ef>") out = render("boom.badlex", "some <code>") -h.equals("a lexer that raises falls back to escaped text", out, - "some <code>") +h.equals("a lexer that raises falls back to escaped text", out, "some <code>") -- The viadetect lexer name only resolves through detect(), so highlighted -- output proves the detection path ran ahead of the extension path. out = render("script.viadetect", "if") -h.equals("filename detection picks the lexer", out, - "<span class='hl-keyword'>if</span>") +h.equals("filename detection picks the lexer", out, "<span class='hl-keyword'>if</span>") out = render("tool.py", "import <x>") -h.equals("an extension with no lexer serves escaped text", out, - "import <x>") +h.equals("an extension with no lexer serves escaped text", out, "import <x>") out = render("noextension", "words <here>") -h.equals("a file with no extension serves escaped text", out, - "words <here>") +h.equals("a file with no extension serves escaped text", out, "words <here>") out = render("big.fake", string.rep("a", 512 * 1024 + 1)) h.excludes("an oversized blob skips the lexing pass", out, "<span") diff --git a/tests/t0002-html-validity.sh b/tests/t0002-html-validity.sh index 0784092..8b04939 100755 --- a/tests/t0002-html-validity.sh +++ b/tests/t0002-html-validity.sh @@ -11,8 +11,7 @@ test_description='Validate html with tidy' test_url() { tidy_options="-eq" - test -z "$NO_TIDY_WARNINGS" || - tidy_options="$tidy_options --show-warnings no" + test -z "$NO_TIDY_WARNINGS" || tidy_options="$tidy_options --show-warnings no" # A second argument names a config of its own, for pages the shared # config keeps turned off. if test -n "$2" diff --git a/tests/t0003-cache.sh b/tests/t0003-cache.sh index 61bf45c..4693988 100755 --- a/tests/t0003-cache.sh +++ b/tests/t0003-cache.sh @@ -150,8 +150,7 @@ test_expect_success 'set up a repo missing a parent object' ' ' test_expect_success 'an error after output began replays none of it' ' - CGIT_CONFIG="$PWD/brokenrc" QUERY_STRING="url=broken/commit/&id=$tip" \ - cgit >broken.out && + CGIT_CONFIG="$PWD/brokenrc" QUERY_STRING="url=broken/commit/&id=$tip" cgit >broken.out && grep "Bad commit" broken.out && test $(grep -c "^Status:" broken.out) = 1 && ls cache4 >broken.slots && @@ -165,8 +164,7 @@ test_expect_success 'an error after output began replays none of it' ' test_expect_success 'an error page leaves no slot behind' ' rm -rf cache3 && mkdir cache3 && CGIT_CONFIG="$PWD/bigkeyrc" \ - QUERY_STRING="url=bigpage/commit/&id=0123456789abcdef0123456789abcdef01234567" \ - cgit >error.out && + QUERY_STRING="url=bigpage/commit/&id=0123456789abcdef0123456789abcdef01234567" cgit >error.out && grep "Bad commit reference" error.out && ls cache3 >error.slots && test_line_count = 0 error.slots diff --git a/tests/t0004-docs.sh b/tests/t0004-docs.sh index 85a4d8e..65c8275 100755 --- a/tests/t0004-docs.sh +++ b/tests/t0004-docs.sh @@ -12,16 +12,13 @@ test_description='Check the configuration documents' ROOT="$TEST_OUTPUT_DIRECTORY/.." test_expect_success 'extract the key lists' ' - sed -n "/^Global settings$/,/^Repository-specific cgitrc file$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Global settings$/,/^Repository-specific cgitrc file$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\([a-z][a-zA-Z0-9.<>-]*\)::$/\1/p" | sort >manual-keys && - sed -n "s/^#\{0,1\}\([a-z][a-zA-Z0-9.<>-]*\)=.*/\1/p" \ - "$ROOT/custom/cgitrc" | + sed -n "s/^#\{0,1\}\([a-z][a-zA-Z0-9.<>-]*\)=.*/\1/p" "$ROOT/custom/cgitrc" | sed -e "s/^mimetype\..*/mimetype.<ext>/" | sort -u >example-keys && - sed -n "s/^#\{0,1\}\(repo\.module-link\)\..*=.*/\1.<path>/p" \ - "$ROOT/custom/cgitrc" >>example-keys && + sed -n "s/^#\{0,1\}\(repo\.module-link\)\..*=.*/\1.<path>/p" "$ROOT/custom/cgitrc" >>example-keys && sort -o example-keys example-keys && test -s manual-keys && test -s example-keys ' @@ -37,15 +34,13 @@ test_expect_success 'every key the reference config sets is documented' ' ' test_expect_success 'the manual lists its global settings in order' ' - sed -n "/^Global settings$/,/^Repository settings$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Global settings$/,/^Repository settings$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\([a-z][a-zA-Z0-9.<>-]*\)::$/\1/p" >global-order && LC_ALL=C sort -c global-order ' test_expect_success 'the manual lists its repository settings in order' ' - sed -n "/^Repository settings$/,/^Repository-specific cgitrc file$/p" \ - "$ROOT/MANUAL.txt" | + sed -n "/^Repository settings$/,/^Repository-specific cgitrc file$/p" "$ROOT/MANUAL.txt" | sed -n "s/^\(repo\.[a-zA-Z0-9.<>-]*\)::$/\1/p" >repo-order && LC_ALL=C sort -c repo-order ' @@ -54,8 +49,7 @@ test_expect_success 'the manual lists its repository settings in order' ' # keeps the three copies from drifting apart. test_expect_success 'the server configs agree on one content security policy' ' for server in apache lighttpd nginx; do - grep "Content-Security-Policy" \ - "$ROOT/custom/servers/$server.conf" | + grep "Content-Security-Policy" "$ROOT/custom/servers/$server.conf" | grep "default-src" | sed "s/.*\"\(default-src[^\"]*\)\".*/\1/" || return 1 done >policies && diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 66686c0..48c8406 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh @@ -52,8 +52,7 @@ test_expect_success 'set up a repo with a nested submodule' ' ' test_expect_success 'generate submodules/tree/vendor' ' - CGIT_CONFIG="$PWD/submodrc" QUERY_STRING="url=submodules/tree/vendor" \ - cgit >tmp + CGIT_CONFIG="$PWD/submodrc" QUERY_STRING="url=submodules/tree/vendor" cgit >tmp ' test_expect_success 'a submodule row shows the entry name alone' ' diff --git a/tests/t0109-patch.sh b/tests/t0109-patch.sh index 0982102..f4168f4 100755 --- a/tests/t0109-patch.sh +++ b/tests/t0109-patch.sh @@ -14,8 +14,7 @@ check_cgit_signature() { } # The version the built binary signs its patches with. -CGIT_VERSION=$(sed -n "s/CGIT_VERSION = //p" \ - "$TEST_OUTPUT_DIRECTORY/../build/VERSION") +CGIT_VERSION=$(sed -n "s/CGIT_VERSION = //p" "$TEST_OUTPUT_DIRECTORY/../build/VERSION") test_expect_success 'generate foo/patch' ' cgit_query "url=foo/patch" >tmp @@ -45,8 +44,7 @@ test_expect_success 'compare with output of git-format-patch(1)' ' ' test_expect_success 'find initial commit' ' - root=$(git --git-dir="$PWD/repos/foo/.git" \ - rev-list --max-parents=0 HEAD) + root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD) ' test_expect_success 'generate patch for initial commit' ' @@ -69,8 +67,7 @@ test_expect_success 'find `cgit` signature on the range' ' test_expect_success 'compare the range with git-format-patch(1)' ' git --git-dir="$PWD/repos/foo/.git" format-patch --subject-prefix="" \ - -N --signature="cgit $CGIT_VERSION" --stdout \ - HEAD~3..HEAD >tmp2 && + -N --signature="cgit $CGIT_VERSION" --stdout HEAD~3..HEAD >tmp2 && strip_headers <tmp >tmp_ && test_cmp tmp_ tmp2 ' @@ -83,10 +80,8 @@ test_expect_success 'max-patch-count bounds a patch range' ' echo "repo.path=$PWD/repos/foo/.git" } >patchcountrc && id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) && - root=$(git --git-dir="$PWD/repos/foo/.git" \ - rev-list --max-parents=0 HEAD) && - CGIT_CONFIG="$PWD/patchcountrc" \ - QUERY_STRING="url=foo/patch&id=$id&id2=$root" cgit >tmp && + root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD) && + CGIT_CONFIG="$PWD/patchcountrc" QUERY_STRING="url=foo/patch&id=$id&id2=$root" cgit >tmp && test $(grep -c "^From " tmp) -eq 2 ' diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh index 2e5127c..6d6d493 100755 --- a/tests/t0301-security.sh +++ b/tests/t0301-security.sh @@ -257,8 +257,7 @@ test_expect_success 'set up a submodule fixture with a hostile module-link' ' ) && mkdir -p scan && cp -R repos/modlink scan/modlink && - printf "module-link=/m/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s\n" \ - >scan/modlink/.git/cgitrc && + printf "module-link=/m/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s/%%s\n" >scan/modlink/.git/cgitrc && { echo "virtual-root=/" && echo "cache-size=0" && diff --git a/tests/t0501-about-render.sh b/tests/t0501-about-render.sh index eff2a61..c2fdb71 100755 --- a/tests/t0501-about-render.sh +++ b/tests/t0501-about-render.sh @@ -20,13 +20,11 @@ test -z "$interpreters" && for lua in $interpreters do test_expect_success "unit checks under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-about-render.lua' \ - '$EXTENSIONS_DIRECTORY/about-render.lua' + '$lua' '$EXT_TEST_DIRECTORY/test-about-render.lua' '$EXTENSIONS_DIRECTORY/about-render.lua' " test_expect_success "fallback checks without lpeg under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-about-render.lua' \ - '$EXTENSIONS_DIRECTORY/about-render.lua' nolpeg + '$lua' '$EXT_TEST_DIRECTORY/test-about-render.lua' '$EXTENSIONS_DIRECTORY/about-render.lua' nolpeg " done diff --git a/tests/t0503-link-commits.sh b/tests/t0503-link-commits.sh index 11b1b54..1dfb28c 100755 --- a/tests/t0503-link-commits.sh +++ b/tests/t0503-link-commits.sh @@ -18,8 +18,7 @@ test -z "$interpreters" && for lua in $interpreters do test_expect_success "unit checks under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-link-commits.lua' \ - '$EXTENSIONS_DIRECTORY/link-commits.lua' + '$lua' '$EXT_TEST_DIRECTORY/test-link-commits.lua' '$EXTENSIONS_DIRECTORY/link-commits.lua' " done diff --git a/tests/t0504-email-avatar.sh b/tests/t0504-email-avatar.sh index 0a4b74f..1af8988 100755 --- a/tests/t0504-email-avatar.sh +++ b/tests/t0504-email-avatar.sh @@ -23,15 +23,13 @@ do for script in email-gravatar email-libravatar do test_expect_success "$script checks under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-email-avatar.lua' \ - '$EXTENSIONS_DIRECTORY/$script.lua' stub + '$lua' '$EXT_TEST_DIRECTORY/test-email-avatar.lua' '$EXTENSIONS_DIRECTORY/$script.lua' stub " if "$lua" -e "require([[openssl.digest]])" >/dev/null 2>&1 then test_expect_success "$script checks with real luaossl under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-email-avatar.lua' \ - '$EXTENSIONS_DIRECTORY/$script.lua' real + '$lua' '$EXT_TEST_DIRECTORY/test-email-avatar.lua' '$EXTENSIONS_DIRECTORY/$script.lua' real " fi done diff --git a/tests/t0505-auth.sh b/tests/t0505-auth.sh index ca379de..2ebee10 100755 --- a/tests/t0505-auth.sh +++ b/tests/t0505-auth.sh @@ -22,8 +22,7 @@ do for variant in inline file do test_expect_success "auth-$variant checks under $lua" " - '$lua' '$EXT_TEST_DIRECTORY/test-auth.lua' \ - '$EXTENSIONS_DIRECTORY/auth-$variant.lua' $variant + '$lua' '$EXT_TEST_DIRECTORY/test-auth.lua' '$EXTENSIONS_DIRECTORY/auth-$variant.lua' $variant " done done @@ -39,8 +38,7 @@ test_expect_success 'create a repository with one commit' ' ' if test "$CGIT_HAS_LUA" -eq 1 && - cgit_lua_probe "$PWD/repos/authy/.git" \ - openssl.rand openssl.hmac posix.sys.stat posix.unistd + cgit_lua_probe "$PWD/repos/authy/.git" openssl.rand openssl.hmac posix.sys.stat posix.unistd then test_set_prereq CGIT_LUA_AUTH else |
