diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-03-01 21:59:27 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-03-01 21:59:27 -0800 |
commit | f3021ab21f796561c1f9f7ad8a0f81ce6c2f2807 (patch) | |
tree | 772eff0686f9944aa8e246a0c9e057010e09f08d /test/test_mime.jl | |
parent | d6c2ac682165bfc4c7ecf9fb7027206735e5bfef (diff) | |
download | PyX.jl-f3021ab21f796561c1f9f7ad8a0f81ce6c2f2807.tar.gz PyX.jl-f3021ab21f796561c1f9f7ad8a0f81ce6c2f2807.zip |
tests: more of them
Diffstat (limited to 'test/test_mime.jl')
-rw-r--r-- | test/test_mime.jl | 28 |
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) + |