diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Fix ampersand handling in generated urls
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0104-tree.sh9
1 file changed, 5 insertions, 4 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh
index c5c5c4c..f4039b6 100755
--- a/tests/t0104-tree.sh
+++ b/tests/t0104-tree.sh
@@ -3,8 +3,9 @@
# The tree page browses a repository at one revision, either as a listing of a
# directory or as a single file with an anchor on every line. The checks
# against the repository named foo+bar cover a file name and a branch name
-# that both contain a plus, which cgit has to spell one way inside a path and
-# another way inside a query.
+# that both contain a plus, which cgit percent-encodes in a path as well as in
+# a query, since a bare plus in a served path would read back as a space when
+# the link is requested through a query string.
test_description='Check content on tree page'
. ./setup.sh
@@ -26,13 +27,13 @@ test_expect_success 'no line 2' '
test_expect_success 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >tmp'
test_expect_success 'verify a+b link' '
- grep "/foo+bar/tree/a+b" tmp
+ grep "/foo%2Bbar/tree/a%2Bb" tmp
'
test_expect_success 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >tmp'
test_expect_success 'verify a+b?h=1+2 link' '
- grep "/foo+bar/tree/a+b?h=1%2b2" tmp
+ grep "/foo%2Bbar/tree/a%2Bb?h=1%2B2" tmp
'
test_done