Turn some test outputs into actual tests

This commit is contained in:
Oleh Prypin 2015-04-21 15:45:30 +03:00
commit 22db40e5e4
13 changed files with 84 additions and 52 deletions

View file

@ -516,7 +516,7 @@ proc register*(mimedb: var MimeDB, ext: string, mimetype: string) =
## Adds ``mimetype`` to the ``mimedb``.
mimedb.mimes[ext] = mimetype
when not defined(testing) and isMainModule:
when isMainModule:
var m = newMimetypes()
echo m.getMimetype("mp4")
echo m.getExt("text/html")
assert m.getMimetype("mp4") == "video/mp4"
assert m.getExt("text/html") == "html"