Diff options
| author | Bryce Kwon <bryce@brycekwon.com> | |
|---|---|---|
| committer | Bryce Kwon <bryce@brycekwon.com> | |
| commit | ||
| parent | ||
| tree | ||
| download | ||
Test a plain listing below the root
| -rwxr-xr-x | tests/t0105-plain.sh | 23 |
1 file changed, 23 insertions, 0 deletions
diff --git a/tests/t0105-plain.sh b/tests/t0105-plain.sh index 97c1164..0ed974e 100755 --- a/tests/t0105-plain.sh +++ b/tests/t0105-plain.sh @@ -34,6 +34,29 @@ test_expect_success 'a directory answers with a listing of links' ' test_grep "<li><a href=./foo/plain/file-5.>file-5</a></li>" tmp ' +# A folder's listing leads back up a level, to the root's listing from a +# folder at the top. +test_expect_success 'a folder listing links its entries and its parent' ' + test_create_repo repos/folders && + ( + cd repos/folders && + mkdir -p dir/sub && + echo a >dir/a.txt && + echo b >dir/sub/b.txt && + git add dir && + git commit -m folders + ) && + cgitrc_repo foldersrc folders && + cgit_ok foldersrc "url=folders/plain/dir" >tmp && + test_grep "<title>/dir/</title>" tmp && + test_grep "<li><a href=./folders/plain/.>\.\./</a></li>" tmp && + test_grep "<li><a href=./folders/plain/dir/a.txt.>a.txt</a></li>" tmp && + test_grep "<li><a href=./folders/plain/dir/sub/.>sub</a></li>" tmp && + cgit_ok foldersrc "url=folders/plain/dir/sub" >tmp && + test_grep "<li><a href=./folders/plain/dir/.>\.\./</a></li>" tmp && + test_grep "<li><a href=./folders/plain/dir/sub/b.txt.>b.txt</a></li>" tmp +' + test_expect_success 'a blob whose bytes look binary is served as octet-stream' ' ( cd repos/foo && |
