Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Show a full index page for a negative offset
The query parser takes an offset as low as -1, which the stats page
reads as every author, so the index clamps it for itself, as the log
and refs pages already do.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/t0101-index.sh | 18 |
1 file changed, 18 insertions, 0 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index d3d4469..1fcd615 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh @@ -146,6 +146,24 @@ test_expect_success 'the idle column shows the date the age file holds' ' test_grep "<td class=.col-idle.><time class=.age-years. datetime=.2005-04-05T10:00:00Z." tmp ' +# An offset as low as -1 gets through for the stats page, and the index read +# it as a page opening a row before its first, one row short and with no +# page in the pager marked as the current one. +test_expect_success 'a negative offset shows the first page of the index' ' + { + echo "max-repo-count=2" && + cat orderrc + } >pagedrc && + printf "%s\n" c a >expect && + for ofs in 0 -1 -100 + do + cgit_ok pagedrc "ofs=$ofs" >tmp && + sed -n "s/.*class=.col-name toplevel-repo.><a href=.\/.\/.>\(.\)<\/a>.*/\1/p" tmp >order && + test_cmp expect order && + test_grep "<a title=.Page 1. class=.current. aria-current=.page. href=./.>\[1\]</a>" tmp || return 1 + done +' + # Fails unless the index of the config named first, asked for with the query # given second, lists the sections, bracketed, and the repositories under # them in the order the rest name. A section heading spans every column, |
