diff options
Diffstat (limited to 'tests/t0104-tree.sh')
-rwxr-xr-x | tests/t0104-tree.sh | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tests/t0104-tree.sh b/tests/t0104-tree.sh index 7aa3b8d..100b026 100755 --- a/tests/t0104-tree.sh +++ b/tests/t0104-tree.sh | |||
@@ -1,33 +1,32 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | test_description='Check content on tree page' | ||
3 | . ./setup.sh | 4 | . ./setup.sh |
4 | 5 | ||
5 | prepare_tests "Check content on tree page" | 6 | test_expect_success 'generate bar/tree' 'cgit_url "bar/tree" >tmp' |
7 | test_expect_success 'find file-1' 'grep "file-1" tmp' | ||
8 | test_expect_success 'find file-50' 'grep "file-50" tmp' | ||
6 | 9 | ||
7 | run_test 'generate bar/tree' 'cgit_url "bar/tree" >trash/tmp' | 10 | test_expect_success 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >tmp' |
8 | run_test 'find file-1' 'grep "file-1" trash/tmp' | ||
9 | run_test 'find file-50' 'grep "file-50" trash/tmp' | ||
10 | 11 | ||
11 | run_test 'generate bar/tree/file-50' 'cgit_url "bar/tree/file-50" >trash/tmp' | 12 | test_expect_success 'find line 1' ' |
12 | 13 | grep "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" tmp | |
13 | run_test 'find line 1' ' | ||
14 | grep "<a class=.no. id=.n1. name=.n1. href=.#n1.>1</a>" trash/tmp | ||
15 | ' | 14 | ' |
16 | 15 | ||
17 | run_test 'no line 2' ' | 16 | test_expect_success 'no line 2' ' |
18 | ! grep "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" trash/tmp | 17 | ! grep "<a class=.no. id=.n2. name=.n2. href=.#n2.>2</a>" tmp |
19 | ' | 18 | ' |
20 | 19 | ||
21 | run_test 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >trash/tmp' | 20 | test_expect_success 'generate foo+bar/tree' 'cgit_url "foo%2bbar/tree" >tmp' |
22 | 21 | ||
23 | run_test 'verify a+b link' ' | 22 | test_expect_success 'verify a+b link' ' |
24 | grep "/foo+bar/tree/a+b" trash/tmp | 23 | grep "/foo+bar/tree/a+b" tmp |
25 | ' | 24 | ' |
26 | 25 | ||
27 | run_test 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >trash/tmp' | 26 | test_expect_success 'generate foo+bar/tree?h=1+2' 'cgit_url "foo%2bbar/tree&h=1%2b2" >tmp' |
28 | 27 | ||
29 | run_test 'verify a+b?h=1+2 link' ' | 28 | test_expect_success 'verify a+b?h=1+2 link' ' |
30 | grep "/foo+bar/tree/a+b?h=1%2b2" trash/tmp | 29 | grep "/foo+bar/tree/a+b?h=1%2b2" tmp |
31 | ' | 30 | ' |
32 | 31 | ||
33 | tests_done | 32 | test_done |