summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorFrédéric Mangano-Tarumi <fmang@mg0.fr>2020-02-02 20:25:08 +0100
committerLukas Fleischer <lfleischer@archlinux.org>2020-02-02 20:49:16 +0100
commit127bb4c84cf8584dd4ee9f544333782d386224ac (patch)
tree253e8e713fa0461f0a9e2c6b74ace911e7182eff /test
parent199f34e42e78ca97f154a4880b77b3f1d01fa9da (diff)
downloadaur-127bb4c84cf8584dd4ee9f544333782d386224ac.tar.gz
aur-127bb4c84cf8584dd4ee9f544333782d386224ac.tar.xz
rendercomment: safer Flyspray task linkification
When an FS#123 is part of a code block, it must not be converted into a link. FS#123 may also appear inside an URL, in which case regular linkifaction of URLs must take precedence. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/t2600-rendercomment.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/t2600-rendercomment.sh b/test/t2600-rendercomment.sh
index b0209eb5..1da422d3 100755
--- a/test/t2600-rendercomment.sh
+++ b/test/t2600-rendercomment.sh
@@ -103,4 +103,30 @@ test_expect_success 'Test Git commit linkification.' '
test_cmp actual expected
'
+test_expect_success 'Test Flyspray issue linkification.' '
+ sqlite3 aur.db <<-EOD &&
+ INSERT INTO PackageComments (ID, PackageBaseID, Comments, RenderedComment) VALUES (6, 1, "
+ FS#1234567.
+ *FS#1234*
+ FS#
+ XFS#1
+ \`FS#1234\`
+ https://archlinux.org/?test=FS#1234
+ ", "");
+ EOD
+ "$RENDERCOMMENT" 6 &&
+ cat <<-EOD >expected &&
+ <p><a href="https://bugs.archlinux.org/task/1234567">FS#1234567</a>.
+ <em><a href="https://bugs.archlinux.org/task/1234">FS#1234</a></em>
+ FS#
+ XFS#1
+ <code>FS#1234</code>
+ <a href="https://archlinux.org/?test=FS#1234">https://archlinux.org/?test=FS#1234</a></p>
+ EOD
+ sqlite3 aur.db <<-EOD >actual &&
+ SELECT RenderedComment FROM PackageComments WHERE ID = 6;
+ EOD
+ test_cmp actual expected
+'
+
test_done