Nim/tests/stdlib/tmimetypes.nim
ringabout 3d2f0e2c7c
make more standard libraries work with nimPreviewSlimSystem (#20343)
* make more standard libraries work with `nimPreviewSlimSystem`

* typo

* part two

* Delete specutils.nim

* fixes more tests

* more fixes

* fixes tests

* fixes three more tests

* add formatfloat import

* fix

* last
2022-09-27 20:06:23 +02:00

19 lines
434 B
Nim

discard """
targets: "c js"
"""
import std/mimetypes
import std/assertions
template main() =
var m = newMimetypes()
doAssert m.getMimetype("mp4") == "video/mp4"
doAssert m.getExt("application/json") == "json"
m.register("foo", "baa")
doAssert m.getMimetype("foo") == "baa"
# see also `runnableExamples`.
# xxx we should have a way to avoid duplicating code between runnableExamples and tests
static: main()
main()