Diff options
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t0303-robustness.sh34
1 file changed, 12 insertions, 22 deletions
diff --git a/tests/t0303-robustness.sh b/tests/t0303-robustness.sh
index 5fc7002..5348b43 100755
--- a/tests/t0303-robustness.sh
+++ b/tests/t0303-robustness.sh
@@ -227,7 +227,9 @@ test_expect_success 'a commit encoding header is read without its newline' '
grep "<div class=.commit-subject.>caf$(printf "\303\251")<" tmp
'
-test_expect_success 'a submodule below the about path does not end the request' '
+# The about page shows the readme alone and its links lead into the tree,
+# so a path below it names nothing, the site about page included.
+test_expect_success 'a path below the about page answers 404' '
(
cd repos/rob &&
git update-index --add --cacheinfo 160000,$sha,sub &&
@@ -238,15 +240,15 @@ test_expect_success 'a submodule below the about path does not end the request'
cat robrc &&
echo "repo.readme=master:file-1"
} >aboutrc &&
- CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="url=rob/about/sub" cgit >tmp 2>err &&
- grep "^Status: 404" tmp &&
- ! grep "fatal" err
-'
-
-test_expect_success 'a missing image on the about page errors as html' '
- CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="url=rob/about/missing.png" cgit >tmp &&
- grep "^Status: 404" tmp &&
- grep "^Content-Type: text/html" tmp
+ for path in sub sub/ missing.png file-1 ../robrc
+ do
+ CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="url=rob/about/$path" cgit >tmp 2>err &&
+ grep "^Status: 404" tmp &&
+ grep "^Content-Type: text/html" tmp &&
+ ! grep fatal err || return 1
+ done &&
+ CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="p=about&path=x" cgit >tmp &&
+ grep "^Status: 404" tmp
'
test_expect_success 'a snapshot name holding a slash is refused' '
@@ -693,18 +695,6 @@ test_expect_success 'the about redirect encodes the repository url once' '
grep "^Location: /foo%2Bbar/$" tmp
'
-# The about page shows the readme alone and its links lead into the tree,
-# so a path below it names nothing, the site about page included.
-test_expect_success 'a path below the about page answers 404' '
- for path in file-1 sub/ ../robrc
- do
- CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="url=rob/about/$path" cgit >tmp &&
- grep "^Status: 404" tmp || return 1
- done &&
- CGIT_CONFIG="$PWD/aboutrc" QUERY_STRING="p=about&path=x" cgit >tmp &&
- grep "^Status: 404" tmp
-'
-
test_expect_success 'a symlink whose target is a large blob is listed without it' '
big=$(head -c 5000 /dev/zero | tr "\0" a | git -C repos/rob hash-object -w --stdin) &&
(