]>
git.cameronkatri.com Git - cgit.git/blob - tests/t0020-validate-cache.sh
3 test_description
='Validate cache'
6 test_expect_success
'verify cache-size=0' '
9 sed -e "s/cache-size=1021$/cache-size=0/" cgitrc >cgitrc.tmp &&
10 mv -f cgitrc.tmp cgitrc &&
13 cgit_url "foo/refs" &&
14 cgit_url "foo/tree" &&
16 cgit_url "foo/diff" &&
17 cgit_url "foo/patch" &&
19 cgit_url "bar/refs" &&
20 cgit_url "bar/tree" &&
22 cgit_url "bar/diff" &&
23 cgit_url "bar/patch" &&
25 test_line_count = 0 output
28 test_expect_success
'verify cache-size=1' '
31 sed -e "s/cache-size=0$/cache-size=1/" cgitrc >cgitrc.tmp &&
32 mv -f cgitrc.tmp cgitrc &&
35 cgit_url "foo/refs" &&
36 cgit_url "foo/tree" &&
38 cgit_url "foo/diff" &&
39 cgit_url "foo/patch" &&
41 cgit_url "bar/refs" &&
42 cgit_url "bar/tree" &&
44 cgit_url "bar/diff" &&
45 cgit_url "bar/patch" &&
47 test_line_count = 1 output
50 test_expect_success
'verify cache-size=1021' '
53 sed -e "s/cache-size=1$/cache-size=1021/" cgitrc >cgitrc.tmp &&
54 mv -f cgitrc.tmp cgitrc &&
57 cgit_url "foo/refs" &&
58 cgit_url "foo/tree" &&
60 cgit_url "foo/diff" &&
61 cgit_url "foo/patch" &&
63 cgit_url "bar/refs" &&
64 cgit_url "bar/tree" &&
66 cgit_url "bar/diff" &&
67 cgit_url "bar/patch" &&
69 test_line_count = 13 output &&
70 cgit_url "foo/ls_cache" >output.full &&
71 strip_headers <output.full >output &&
72 test_line_count = 13 output &&
73 # Check that ls_cache output is cached correctly
74 cgit_url "foo/ls_cache" >output.second &&
75 test_cmp output.full output.second