aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-12 10:37:38 +0500
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-12 10:37:38 +0500
commit003b94adfce7384b08a5e0042ccbfe3b92ada397 (patch)
treef89da384aea8608c391fc4dbad001ad071ce4f70 /test
parentdocker-compose: add volume for the state file (diff)
downloadvoid-003b94adfce7384b08a5e0042ccbfe3b92ada397.tar.gz
void-003b94adfce7384b08a5e0042ccbfe3b92ada397.zip
test: add more tests, fix undetected failures
Diffstat (limited to 'test')
-rwxr-xr-xtest/test.sh22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/test.sh b/test/test.sh
index f01ce68..46c136f 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -108,6 +108,9 @@ curl_check_keyword() {
if ! grep --fixed-strings --quiet -- "$keyword" "$curl_output_file"; then
dump "The following pattern hasn't been found:"
dump "$keyword"
+ dump "The output was:"
+ cat -- "$curl_output_file"
+ return 1
fi
done
}
@@ -133,11 +136,14 @@ run_curl_test() {
run_curl_tests() {
# / and /index.html are identical:
- #run_curl_test '/' '<link rel="stylesheet" href="css/bootstrap.min.css">' 'var status_refresh_interval_seconds'
- #run_curl_test '/index.html' '<link rel="stylesheet" href="css/bootstrap.min.css">' 'var status_refresh_interval_seconds'
+ run_curl_test / '<title>Орём!</title>' 'var screams_now'
+ run_curl_test /index.html '<title>Орём!</title>' 'var screams_now'
- run_curl_test '/screams' '0'
- run_curl_test '/scream' '1'
+ run_curl_test /screams 0
+ run_curl_test /scream 1
+ run_curl_test /scream 2
+ run_curl_test /scream 3
+ run_curl_test /screams 3
}
cgi_check_header() {
@@ -179,8 +185,12 @@ run_cgi_test() {
run_cgi_tests() {
# Check that app.py still works as a CGI script.
- run_cgi_test 'screams' '0'
- run_cgi_test 'scream' '1'
+ # app.py doesn't save state between invocations, obviously.
+ run_cgi_test screams 0
+ run_cgi_test scream 1
+ run_cgi_test scream 1
+ run_cgi_test scream 1
+ run_cgi_test screams 0
}
main() {