aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_mime.jl
blob: 12c1e7cd196b5fd1bbedfad41e9f7837f41920d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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)