-rwxr-xr-x | tests/setup.sh | 13 | ||||
-rwxr-xr-x | tests/t0101-index.sh | 2 | ||||
-rwxr-xr-x | tests/t0104-tree.sh | 12 |
3 files changed, 26 insertions, 1 deletions
diff --git a/tests/setup.sh b/tests/setup.sh index e37306e..1457dd5 100755 --- a/tests/setup.sh +++ b/tests/setup.sh | |||
@@ -32,4 +32,11 @@ mkrepo() { | |||
32 | git commit -m "commit $n" | 32 | git commit -m "commit $n" |
33 | done | 33 | done |
34 | if test "$3" = "testplus" | ||
35 | then | ||
36 | echo "hello" >a+b | ||
37 | git add a+b | ||
38 | git commit -m "add a+b" | ||
39 | git branch "1+2" | ||
40 | fi | ||
34 | cd $dir | 41 | cd $dir |
35 | } | 42 | } |
@@ -41,4 +48,5 @@ setup_repos() | |||
41 | mkrepo trash/repos/foo 5 >/dev/null | 48 | mkrepo trash/repos/foo 5 >/dev/null |
42 | mkrepo trash/repos/bar 50 >/dev/null | 49 | mkrepo trash/repos/bar 50 >/dev/null |
50 | mkrepo trash/repos/foo+bar 10 testplus >/dev/null | ||
43 | cat >trash/cgitrc <<EOF | 51 | cat >trash/cgitrc <<EOF |
44 | virtual-root=/ | 52 | virtual-root=/ |
@@ -62,4 +70,8 @@ repo.url=bar | |||
62 | repo.path=$PWD/trash/repos/bar/.git | 70 | repo.path=$PWD/trash/repos/bar/.git |
63 | repo.desc=the bar repo | 71 | repo.desc=the bar repo |
72 | |||
73 | repo.url=foo+bar | ||
74 | repo.path=$PWD/trash/repos/foo+bar/.git | ||
75 | repo.desc=the foo+bar repo | ||
64 | EOF | 76 | EOF |
65 | } | 77 | } |
@@ -114,3 +126,2 @@ cgit_url() | |||
114 | CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="url=$1" "$PWD/../cgit" | 126 | CGIT_CONFIG="$PWD/trash/cgitrc" QUERY_STRING="url=$1" "$PWD/../cgit" |
115 | } | 127 | } |
116 | |||
diff --git a/tests/t0101-index.sh b/tests/t0101-index.sh index 445af6a..07e39f9 100755 --- a/tests/t0101-index.sh +++ b/tests/t0101-index.sh | |||
@@ -10,4 +10,6 @@ run_test 'find foo description' 'grep -e "\[no description\]" trash/tmp' | |||
10 | run_test 'find bar repo' 'grep -e "bar" trash/tmp' | 10 | run_test 'find bar repo' 'grep -e "bar" trash/tmp' |
11 | run_test 'find bar description' 'grep -e "the bar repo" trash/tmp' | 11 | run_test 'find bar description' 'grep -e "the bar repo" trash/tmp' |
12 | run_test 'find foo+bar repo' 'grep -e ">foo+bar<" trash/tmp' | ||
13 | run_test 'verify foo+bar link' 'grep -e "/foo+bar/" trash/tmp' | ||
12 | run_test 'no tree-link' '! grep -e "foo/tree" trash/tmp' | 14 | run_test 'no tree-link' '! grep -e "foo/tree" trash/tmp' |
13 | run_test 'no log-link' '! grep -e "foo/log" trash/tmp' | 15 | run_test 'no log-link' '! grep -e "foo/log" trash/tmp' |
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 2516c72..0d62cc8 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh | |||
@@ -19,3 +19,15 @@ run_test 'no line 2' ' | |||
19 | ' | 19 | ' |
20 | 20 | ||
21 | run_test 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >trash/tmp' | ||
22 | |||
23 | run_test 'verify a+b link' ' | ||
24 | grep -e "/foo+bar/tree/a+b" trash/tmp | ||
25 | ' | ||
26 | |||
27 | run_test 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >trash/tmp' | ||
28 | |||
29 | run_test 'verify a+b?h=1+2 link' ' | ||
30 | grep -e "/foo+bar/tree/a+b?h=1%2b2" trash/tmp | ||
31 | ' | ||
32 | |||
21 | tests_done | 33 | tests_done |