diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Ship the example tracker links commented out
An unedited copy sent every #123, Closes: and Bug: mark to bugs.example.com, a link that is wrong for every site.
Diffstat (limited to 'tests/extensions/test-link-commits.lua')
-rw-r--r--tests/extensions/test-link-commits.lua13
1 file changed, 10 insertions, 3 deletions
diff --git a/tests/extensions/test-link-commits.lua b/tests/extensions/test-link-commits.lua
index 07b2fdb..fdd1787 100644
--- a/tests/extensions/test-link-commits.lua
+++ b/tests/extensions/test-link-commits.lua
@@ -1,7 +1,8 @@
-- Unit checks for custom/extensions/link-commits.lua, run under a standalone
-- Lua by t0503-link-commits.sh with the script path as the argument. The
--- shipped configuration links bare object names to ./?id= and issue marks
--- like #123 to bugs.example.com, and everything here checks that shape, the
+-- shipped configuration links bare object names to ./?id= and leaves issue
+-- marks as text. The rest runs with the commented-out issue rule switched on,
+-- linking marks like #123 to bugs.example.com, and checks that shape, the
-- length bounds and frontier on hash recognition, and the rule that no run
-- of text is ever wrapped twice.
@@ -14,7 +15,13 @@ local function render(text)
return h.run({}, { text })
end
-local out, ret = render("see #123 for details")
+local out, ret = render("see #123 near deadbee")
+h.equals("an unedited copy leaves issue marks as text", out,
+ "see #123 near <a href='./?id=deadbee'>deadbee</a>")
+
+h.load_with(arg[1], { { "-- { pattern = \"#(%d+)\"", "{ pattern = \"#(%d+)\"" } })
+
+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("text around the link survives", out, "see ")
h.contains("text after the link survives", out, " for details")