Nim/tests/stdlib/tmimetypes.nim
David Krause cda77c1520
use OrderedTable instead of OrderedTableRef for mimedb (#19522)
* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>

* added changelog entry for mimedb change

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
2022-02-14 08:56:35 +01:00

16 lines
410 B
Nim

discard """
targets: "c js"
"""
import std/mimetypes
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()