mirror of https://github.com/omar-polo/gmid.git
add tests for the type block
This commit is contained in:
parent
ee219d702e
commit
fb1212266f
|
@ -83,3 +83,4 @@ testdata: fill-file
|
||||||
mkdir testdata/dir
|
mkdir testdata/dir
|
||||||
cp hello testdata/dir
|
cp hello testdata/dir
|
||||||
cp testdata/index.gmi testdata/dir/foo.gmi
|
cp testdata/index.gmi testdata/dir/foo.gmi
|
||||||
|
touch testdata/test.m3u8 testdata/foo.1
|
||||||
|
|
|
@ -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
|
|
@ -58,5 +58,6 @@ run_test test_174_bugfix
|
||||||
run_test test_proxy_relay_to
|
run_test test_proxy_relay_to
|
||||||
run_test test_proxy_with_certs
|
run_test test_proxy_with_certs
|
||||||
run_test test_unknown_host
|
run_test test_unknown_host
|
||||||
|
run_test test_include_mime
|
||||||
|
|
||||||
tests_done
|
tests_done
|
||||||
|
|
|
@ -370,3 +370,16 @@ test_unknown_host() {
|
||||||
fetch /
|
fetch /
|
||||||
check_reply '59 Wrong/malformed host or missing SNI'
|
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'
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue