aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_mime.jl
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_mime.jl')
-rw-r--r--test/test_mime.jl28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/test_mime.jl b/test/test_mime.jl
new file mode 100644
index 0000000..12c1e7c
--- /dev/null
+++ b/test/test_mime.jl
@@ -0,0 +1,28 @@
+
+function try_mime(el)
+
+ for m in (MIME("application/pdf"),
+ MIME("application/eps"),
+ MIME("application/postscript"),
+ MIME("image/png"),
+ MIME("image/jpeg"),
+ )
+ @assert mimewritable(m, c)
+ open("/dev/null", "w") do f
+ writemime(f, m, el)
+ end
+ end
+
+ if mimewritable(MIME("image/svg+xml"), el)
+ stringmime(MIME("image/svg+xml"), el)
+ open("/tmp/asdfasfd.svg", "w") do f
+ writemime(f, MIME"image/svg+xml"(), el)
+ end
+ end
+ true
+end
+
+@test try_mime(c)
+@test try_mime(g)
+@test try_mime(g3d)
+