aboutsummaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-02-26 14:02:45 +0000
committerOmar Polo <op@omarpolo.com>2022-02-26 14:02:45 +0000
commitfb1212266f366f457b0c142869b8095213fc5b96 (patch)
tree937153ed8f48fc1e5e0d861f92b28ad70ace4a11 /regress
parentee219d702e4b1db5a985be5087f0e682b567618b (diff)
add tests for the type block
Diffstat (limited to 'regress')
-rw-r--r--regress/Makefile1
-rw-r--r--regress/example.mime.types9
-rwxr-xr-xregress/regress1
-rw-r--r--regress/tests.sh13
4 files changed, 24 insertions, 0 deletions
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'
+}