diff --git a/regress/Makefile b/regress/Makefile index 4f224ea..8408870 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -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 diff --git a/regress/example.mime.types b/regress/example.mime.types new file mode 100644 index 0000000..b7c8e2a --- /dev/null +++ b/regress/example.mime.types @@ -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 diff --git a/regress/regress b/regress/regress index a88a269..9bce95d 100755 --- a/regress/regress +++ b/regress/regress @@ -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 diff --git a/regress/tests.sh b/regress/tests.sh index 9fae42d..c736a40 100644 --- a/regress/tests.sh +++ b/regress/tests.sh @@ -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' +}