summary refs log tree commit diff stats
path: root/tests/test_nimscript.nims
blob: a2e8ac94575bd6d628dd7efb98bb50f9c4363c1b (plain) (blame)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This nimscript is used to test if the following modules can be imported
# http://nim-lang.org/docs/nims.html

{.warning[UnusedImport]: off.}

import std/[
  # Core:
  bitops, typetraits, lenientops, macros, volatile,
  # fails: typeinfo, endians
  # works but shouldn't: cpuinfo, rlocks, locks

  # Algorithms:
  algorithm, sequtils,

  # Collections:
  critbits, deques, heapqueue, intsets, lists, options, sets,
  sharedlist, tables,
  # fails: sharedtables

  # Strings:
  editdistance, wordwrap, parseutils, ropes,
  pegs, punycode, strformat, strmisc, strscans, strtabs,
  strutils, unicode, unidecode,
  # works but shouldn't: cstrutils, encodings

  # Time handling:
  # fails: monotimes, times
  # but times.getTime() implemented for VM

  # Generic operator system services:
  os, streams,
  # fails: distros, dynlib, marshal, memfiles, osproc, terminal

  # Math libraries:
  complex, math, mersenne, random, rationals, stats, sums,
  # works but shouldn't: fenv

  # Internet protocols:
  httpcore, mimetypes, uri,
  # fails: asyncdispatch, asyncfile, asyncftpclient, asynchttpserver,
  # asyncnet, cgi, cookies, httpclient, nativesockets, net, selectors, smtp
  # works but shouldn't test: asyncstreams, asyncfutures

  # Threading:
  # fails: threadpool

  # Parsers:
  htmlparser, json, lexbase, parsecfg, parsecsv, parsesql, parsexml,
  # fails: parseopt

  # XML processing:
  xmltree, xmlparser,

  # Generators:
  htmlgen,

  # Hashing:
  base64, hashes,
  # fails: md5, oids, sha1

  # Miscellaneous:
  colors, sugar, varints,
  # fails: browsers, coro, logging (times), segfaults, unittest (uses methods)

  # Modules for JS backend:
  # fails: asyncjs, dom, jsconsole, jscore, jsffi,

  # Unlisted in lib.html:
  decls, compilesettings, with, wrapnils
]


block:
  doAssert "./foo//./bar/".normalizedPath == "foo/bar".unixToNativePath

when false: # #14142
  discard existsDir("/usr")
  discard dirExists("/usr")
  discard existsFile("/usr/foo")
  discard fileExists("/usr/foo")
  discard findExe("nim")

echo "Nimscript imports are successful."