diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Test the features the suite never reached
Index sorting, the commit graph, the stats periods past a week, the hex dump of a binary file and a Lua filter's html_url_arg and html_include ran in no test.
Diffstat (limited to 'tests/t0101-index.sh')
-rwxr-xr-xtests/t0101-index.sh13
1 file changed, 13 insertions, 0 deletions
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh
index e433beb..8d389b6 100755
--- a/tests/t0101-index.sh
+++ b/tests/t0101-index.sh
@@ -67,4 +67,17 @@ test_expect_success 'a cut description keeps whole characters' '
grep ">日本語\.\.\.</a>" tmp
'
+# The index sorts by a column only when asked, which nothing else exercises.
+test_expect_success 'the index sorts by a column on request' '
+ cgit_query "s=name" >tmp &&
+ bar=$(grep -n ">bar</a>" tmp | head -1 | cut -d: -f1) &&
+ foo=$(grep -n ">foo</a>" tmp | head -1 | cut -d: -f1) &&
+ test "$bar" -lt "$foo" &&
+ for s in desc owner idle
+ do
+ cgit_query "s=$s" >tmp &&
+ grep ">foo</a>" tmp || return 1
+ done
+'
+
test_done