add tests for the type block

This commit is contained in:
Omar Polo 2022-02-26 14:02:45 +00:00
parent ee219d702e
commit fb1212266f
4 changed files with 24 additions and 0 deletions

View File

@ -83,3 +83,4 @@ testdata: fill-file
mkdir testdata/dir
cp hello testdata/dir
cp testdata/index.gmi testdata/dir/foo.gmi
touch testdata/test.m3u8 testdata/foo.1

View File

@ -0,0 +1,9 @@
# example mime.types file FOR REGRESS TESTS ONLY!
application/vnd.apple.mpegurl m3u8
application/x-perl pl pm
# some empty lines because I can
text/x-mandoc 1 2 3 4 5 6 7 8 9
text/x-mandoc 3bsd

View File

@ -58,5 +58,6 @@ run_test test_174_bugfix
run_test test_proxy_relay_to
run_test test_proxy_with_certs
run_test test_unknown_host
run_test test_include_mime
tests_done

View File

@ -370,3 +370,16 @@ test_unknown_host() {
fetch /
check_reply '59 Wrong/malformed host or missing SNI'
}
test_include_mime() {
setup_simple_test "types { include '$PWD/example.mime.types' }" ""
fetch_hdr /
check_reply '20 text/gemini'
fetch_hdr /test.m3u8
check_reply '20 application/vnd.apple.mpegurl'
fetch_hdr /foo.1
check_reply '20 text/x-mandoc'
}