Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Ask for a url through cgit_url everywhere
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0106-commit.sh6
-rwxr-xr-xtests/t0107-diff.sh6
-rwxr-xr-xtests/t0108-rawdiff.sh8
-rwxr-xr-xtests/t0109-patch.sh6
-rwxr-xr-xtests/t0208-mailmap.sh4
-rwxr-xr-xtests/t0301-security.sh6
-rwxr-xr-xtests/t0501-about-render.sh2
7 files changed, 19 insertions, 19 deletions
diff --git a/tests/t0106-commit.sh b/tests/t0106-commit.sh
index 6c8361a..d420585 100755
--- a/tests/t0106-commit.sh
+++ b/tests/t0106-commit.sh
@@ -66,7 +66,7 @@ test_expect_success 'a message that is not UTF-8 has its stray bytes replaced' '
cid=$(git hash-object --literally -t commit -w raw) &&
git update-ref refs/heads/latin "$cid"
) &&
- cgit_query "url=foo/commit&h=latin" >tmp &&
+ cgit_url "foo/commit&h=latin" >tmp &&
grep "<div class=.commit-subject.>caf? subject<" tmp &&
grep "body ? end" tmp &&
! grep "caf$(printf "\351")" tmp
@@ -78,9 +78,9 @@ test_expect_success 'an octopus merge, which draws no diff, offers no diff optio
cid=$(git commit-tree -p HEAD -p HEAD~1 -p HEAD~2 -m octopus HEAD^{tree}) &&
git update-ref refs/heads/octopus "$cid"
) &&
- cgit_query "url=foo/commit&h=octopus" >tmp &&
+ cgit_url "foo/commit&h=octopus" >tmp &&
! grep "cgit-panel" tmp &&
- cgit_query "url=foo/commit" >tmp &&
+ cgit_url "foo/commit" >tmp &&
grep "cgit-panel" tmp
'
diff --git a/tests/t0107-diff.sh b/tests/t0107-diff.sh
index 6710cec..a3948df 100755
--- a/tests/t0107-diff.sh
+++ b/tests/t0107-diff.sh
@@ -26,9 +26,9 @@ test_expect_success 'find added line' '
# the commit and patch pages quote it, on either side of the diff.
test_expect_success 'a tree on either side is named as the request gave it' '
tree=$(git -C repos/foo rev-parse --short HEAD^{tree}) &&
- cgit_query "url=foo/diff/&id=$tree" >tmp &&
+ cgit_url "foo/diff/&id=$tree" >tmp &&
grep "<div class=.error.>Not a commit: $tree</div>" tmp &&
- cgit_query "url=foo/diff/&id2=$tree" >tmp &&
+ cgit_url "foo/diff/&id2=$tree" >tmp &&
grep "<div class=.error.>Not a commit: $tree</div>" tmp
'
@@ -58,7 +58,7 @@ test_expect_success 'ssdiff numbers a comma-less hunk from its real line' '
'
test_expect_success 'ssdiff still numbers a hunk that carries a length' '
- cgit_query "url=foo/diff&dt=1" >tmp &&
+ cgit_url "foo/diff&dt=1" >tmp &&
grep "#n1.>1</a>" tmp
'
diff --git a/tests/t0108-rawdiff.sh b/tests/t0108-rawdiff.sh
index 3d910d3..500407f 100755
--- a/tests/t0108-rawdiff.sh
+++ b/tests/t0108-rawdiff.sh
@@ -8,7 +8,7 @@ test_description='Check content on rawdiff page'
. ./setup.sh
test_expect_success 'generate foo/rawdiff' '
- cgit_query "url=foo/rawdiff" >tmp
+ cgit_url "foo/rawdiff" >tmp
'
test_expect_success 'compare with output of git-diff(1)' '
@@ -22,7 +22,7 @@ test_expect_success 'find initial commit' '
'
test_expect_success 'generate diff for initial commit' '
- cgit_query "url=foo/rawdiff&id=$root" >tmp
+ cgit_url "foo/rawdiff&id=$root" >tmp
'
test_expect_success 'compare with output of git-diff-tree(1)' '
@@ -34,7 +34,7 @@ test_expect_success 'compare with output of git-diff-tree(1)' '
test_expect_success 'generate diff for multiple commits' '
id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) &&
id2=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD~3) &&
- cgit_query "url=foo/rawdiff&id=$id&id2=$id2" >tmp
+ cgit_url "foo/rawdiff&id=$id&id2=$id2" >tmp
'
test_expect_success 'compare with output of git-diff(1)' '
@@ -44,7 +44,7 @@ test_expect_success 'compare with output of git-diff(1)' '
'
test_expect_success 'a path limits the diff to that file' '
- cgit_query "url=foo/rawdiff/file-4&id=$id&id2=$id2" >tmp &&
+ cgit_url "foo/rawdiff/file-4&id=$id&id2=$id2" >tmp &&
git --git-dir="$PWD/repos/foo/.git" diff HEAD~3..HEAD -- file-4 >tmp2 &&
strip_headers <tmp >tmp_ &&
cmp tmp_ tmp2 &&
diff --git a/tests/t0109-patch.sh b/tests/t0109-patch.sh
index 52f2abc..f37a23e 100755
--- a/tests/t0109-patch.sh
+++ b/tests/t0109-patch.sh
@@ -18,7 +18,7 @@ check_cgit_signature() {
}
test_expect_success 'generate foo/patch' '
- cgit_query "url=foo/patch" >tmp
+ cgit_url "foo/patch" >tmp
'
test_expect_success 'compare with output of git-format-patch(1)' '
@@ -33,7 +33,7 @@ test_expect_success 'find initial commit' '
'
test_expect_success 'generate patch for initial commit' '
- cgit_query "url=foo/patch&id=$root" >tmp
+ cgit_url "foo/patch&id=$root" >tmp
'
test_expect_success 'find `cgit` signature on the initial commit' '
@@ -43,7 +43,7 @@ test_expect_success 'find `cgit` signature on the initial commit' '
test_expect_success 'generate patches for multiple commits' '
id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) &&
id2=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD~3) &&
- cgit_query "url=foo/patch&id=$id&id2=$id2" >tmp
+ cgit_url "foo/patch&id=$id&id2=$id2" >tmp
'
test_expect_success 'compare the range with git-format-patch(1)' '
diff --git a/tests/t0208-mailmap.sh b/tests/t0208-mailmap.sh
index ec33cd9..9e9ae0f 100755
--- a/tests/t0208-mailmap.sh
+++ b/tests/t0208-mailmap.sh
@@ -62,9 +62,9 @@ test_expect_success 'the atom feed uses the mapped name and address' '
'
test_expect_success 'the author search matches the mapped name' '
- cgit_query "url=mapped/log/&qt=author&q=New+Name" >tmp &&
+ cgit_url "mapped/log/&qt=author&q=New+Name" >tmp &&
grep ">first commit</a>" tmp &&
- cgit_query "url=mapped/log/&qt=author&q=Nobody" >tmp &&
+ cgit_url "mapped/log/&qt=author&q=Nobody" >tmp &&
! grep ">first commit</a>" tmp
'
diff --git a/tests/t0301-security.sh b/tests/t0301-security.sh
index 3fc491f..c75c791 100755
--- a/tests/t0301-security.sh
+++ b/tests/t0301-security.sh
@@ -30,7 +30,7 @@ test_expect_success 'set up security fixtures' '
# tip, so a request for id=--output=<path> could create or truncate any file
# the server is able to write.
test_expect_success 'log id=--output does not write a file' '
- cgit_query "url=foo/log&id=--output=$PWD/pwned" >tmp 2>&1 &&
+ cgit_url "foo/log&id=--output=$PWD/pwned" >tmp 2>&1 &&
! test -e pwned
'
@@ -40,7 +40,7 @@ test_expect_success 'log id=--output is rejected as an invalid revision' '
test_expect_success 'a valid id= still renders the log' '
sha=$(git -C repos/foo rev-parse HEAD) &&
- cgit_query "url=foo/log&id=$sha" >tmp &&
+ cgit_url "foo/log&id=$sha" >tmp &&
grep -i "commit 5" tmp
'
@@ -97,7 +97,7 @@ test_expect_success 'root-readme without a filter is its own page, as written' '
# button and its selects carry no handlers at all.
test_expect_success 'diff options submit through a button' '
sha=$(git -C repos/foo rev-parse HEAD) &&
- cgit_query "url=foo/commit&id=$sha" >tmp &&
+ cgit_url "foo/commit&id=$sha" >tmp &&
grep "type=.submit. value=.reload." tmp &&
! grep "onchange" tmp
'
diff --git a/tests/t0501-about-render.sh b/tests/t0501-about-render.sh
index 97ac08c..e4eaf5c 100755
--- a/tests/t0501-about-render.sh
+++ b/tests/t0501-about-render.sh
@@ -100,7 +100,7 @@ test_expect_success CGIT_LUA_LPEG 'a relative link leads into the tree' '
'
test_expect_success CGIT_LUA_LPEG 'the link stays on the branch shown' '
- cgit_query "url=md/about/&h=next" >tmp &&
+ cgit_url "md/about/&h=next" >tmp &&
grep "<a href=./md/tree/ROADMAP.md?h=next#plan.>roadmap</a>" tmp
'