test_nimscript.nims 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # This nimscript is used to test if the following modules can be imported
  2. # http://nim-lang.org/docs/nims.html
  3. {.warning[UnusedImport]: off.}
  4. import std/[
  5. # Core:
  6. bitops, typetraits, lenientops, macros, volatile,
  7. # fails: typeinfo, endians
  8. # works but shouldn't: cpuinfo, rlocks, locks
  9. # Algorithms:
  10. algorithm, sequtils,
  11. # Collections:
  12. critbits, deques, heapqueue, intsets, lists, options, sets,
  13. sharedlist, tables,
  14. # fails: sharedtables
  15. # Strings:
  16. editdistance, wordwrap, parseutils, ropes,
  17. pegs, punycode, strformat, strmisc, strscans, strtabs,
  18. strutils, unicode, unidecode,
  19. # works but shouldn't: cstrutils, encodings
  20. # Time handling:
  21. # fails: monotimes, times
  22. # but times.getTime() implemented for VM
  23. # Generic operator system services:
  24. os, streams,
  25. # fails: distros, dynlib, marshal, memfiles, osproc, terminal
  26. # Math libraries:
  27. complex, math, mersenne, random, rationals, stats, sums,
  28. # works but shouldn't: fenv
  29. # Internet protocols:
  30. httpcore, mimetypes, uri,
  31. # fails: asyncdispatch, asyncfile, asyncftpclient, asynchttpserver,
  32. # asyncnet, cgi, cookies, httpclient, nativesockets, net, selectors, smtp
  33. # works but shouldn't test: asyncstreams, asyncfutures
  34. # Threading:
  35. # fails: threadpool
  36. # Parsers:
  37. htmlparser, json, lexbase, parsecfg, parsecsv, parsesql, parsexml,
  38. # fails: parseopt
  39. # XML processing:
  40. xmltree, xmlparser,
  41. # Generators:
  42. htmlgen,
  43. # Hashing:
  44. base64, hashes,
  45. # fails: md5, oids, sha1
  46. # Miscellaneous:
  47. colors, sugar, varints,
  48. # fails: browsers, coro, logging (times), segfaults, unittest (uses methods)
  49. # Modules for JS backend:
  50. # fails: asyncjs, dom, jsconsole, jscore, jsffi,
  51. # Unlisted in lib.html:
  52. decls, compilesettings, with, wrapnils
  53. ]
  54. echo "Nimscript imports are successful."
  55. block:
  56. doAssert "./foo//./bar/".normalizedPath == "foo/bar".unixToNativePath
  57. block:
  58. doAssert $3'u == "3"
  59. doAssert $3'u64 == "3"
  60. block: # #14142
  61. discard dirExists("/usr")
  62. discard fileExists("/usr/foo")
  63. discard findExe("nim")
  64. block:
  65. doAssertRaises(AssertionDefect): doAssert false
  66. try: doAssert false
  67. except Exception as e:
  68. discard