Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Check that a ref page lists from its offset
Both paging tests would have passed with the listing ignoring ofs,
since the prev link comes from ofs alone.
| -rwxr-xr-x | tests/t0204-limits.sh | 27 |
1 file changed, 18 insertions, 9 deletions
diff --git a/tests/t0204-limits.sh b/tests/t0204-limits.sh index 5250811..caf24e9 100755 --- a/tests/t0204-limits.sh +++ b/tests/t0204-limits.sh @@ -65,20 +65,29 @@ test_expect_success 'refs page links each overflow to its own category' ' grep "refs/tags" tmp ' +# The branches sort by name, so the second page holds branch-3 and master. test_expect_success 'branch page paginates independently' ' - cgit_rc limitrc "url=limits/refs/heads/" >tmp && + cgit_ok limitrc "url=limits/refs/heads/" >tmp && test $(grep -c "log/?h=" tmp) -eq 2 && - grep "\[next\]" tmp && - cgit_rc limitrc "url=limits/refs/heads/&ofs=2" >tmp && - grep "\[prev\]" tmp && - ! grep "/tag/?h=tag-" tmp + test_grep "log/?h=branch-1." tmp && + test_grep "\[next\]" tmp && + cgit_ok limitrc "url=limits/refs/heads/&ofs=2" >tmp && + test_grep "\[prev\]</a> 3 - 4 of 4" tmp && + test_grep "log/?h=branch-3." tmp && + test_grep "href=./limits/log/.>master</a>" tmp && + test_grep ! "log/?h=branch-1." tmp && + test_grep ! "/tag/?h=tag-" tmp ' test_expect_success 'tag page paginates independently' ' - cgit_rc limitrc "url=limits/refs/tags/&ofs=2" >tmp && - grep "/tag/?h=tag-" tmp && - grep "\[prev\]" tmp && - ! grep "log/?h=" tmp + cgit_ok limitrc "url=limits/refs/tags/" >tmp && + test_grep "/tag/?h=tag-1." tmp && + test_grep "1 - 2 of 3" tmp && + cgit_ok limitrc "url=limits/refs/tags/&ofs=2" >tmp && + test_grep "\[prev\]</a> 3 - 3 of 3" tmp && + test_grep "/tag/?h=tag-3." tmp && + test_grep ! "/tag/?h=tag-1." tmp && + test_grep ! "log/?h=" tmp ' # A count of 0 lists every ref, and a negative one has to mean the same |
