1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
test_description='Check the preview server splits CGI output correctly'
CGIT_TEST_NO_CREATE_REPOS=YesPlease
. ./setup.sh
PYTHON=$(HOME=$USER_HOME python3 -I -c 'import sys; print(sys.executable)' 2>/dev/null)
test_lazy_prereq PYTHON '
test -n "$PYTHON" &&
"$PYTHON" -I -c "import sys; sys.exit(sys.version_info < (3, 8))"
'
test_have_prereq PYTHON || {
skip_all='Skipping preview server tests: no python3 3.8 or later'
test_done
}
split_check() {
"$PYTHON" -I "$TEST_OUTPUT_DIRECTORY/serve-split-check.py" \
"$TEST_OUTPUT_DIRECTORY/.." "$1"
}
test_expect_success 'a CRLF blank line in the body stays in the body' '
split_check crlf-in-body
'
test_expect_success 'an LF blank line after CRLF headers stays in the body' '
split_check lf-in-body
'
test_expect_success 'a status line is taken off the headers' '
split_check status
'
test_expect_success 'an empty body survives, as a redirect leaves one' '
split_check empty-body
'
test_expect_success 'output with no blank line at all is all headers' '
split_check no-blank-line
'
test_done
|