Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strictFuncs+views: add test that imports stdlib modules #16878

Merged
merged 1 commit into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions tests/effects/tstrict_funcs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ discard """
"""

import tables, streams, parsecsv
# We import the below modules to check that they compile with `strictFuncs`.
# They are otherwise unused in this file.
import
complex,
critbits,
httpcore,
math,
nre,
rationals,
sequtils,
strutils,
uri

type
Contig2Reads = TableRef[string, seq[string]]
Expand Down
177 changes: 177 additions & 0 deletions tests/effects/tstrict_funcs_imports.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
discard """
cmd: "nim $target $options --hints:on --experimental:strictFuncs --experimental:views --threads:on -d:ssl -d:nimCoroutines $file"
targets: "c"
"""
{.warning[UnusedImport]: off.}

when defined(linux):
import linenoise

import
algorithm,
asyncdispatch,
asyncfile,
asyncftpclient,
asyncfutures,
asynchttpserver,
asyncmacro,
asyncnet,
asyncstreams,
atomics,
base64,
bitops,
browsers,
cgi,
chains,
colors,
complex,
cookies,
coro,
cpuinfo,
cpuload,
critbits,
cstrutils,
db_common,
db_mysql,
db_odbc,
db_postgres,
db_sqlite,
deques,
distros,
dynlib,
encodings,
endians,
epoll,
fenv,
hashes,
heapqueue,
hotcodereloading,
htmlgen,
htmlparser,
httpclient,
httpcore,
inotify,
intsets,
json,
kqueue,
lenientops,
lexbase,
lists,
locks,
logging,
macrocache,
macros,
marshal,
math,
md5,
memfiles,
mersenne,
mimetypes,
nativesockets,
net,
nimhcr,
# nimprof,
nre,
oids,
options,
os,
osproc,
parsecfg,
parsecsv,
parsejson,
parseopt,
parsesql,
parseutils,
parsexml,
pathnorm,
# pegs,
posix_utils,
prelude,
punycode,
random,
rationals,
rdstdin,
re,
registry,
reservedmem,
rlocks,
ropes,
rtarrays,
selectors,
sequtils,
sets,
sharedlist,
sharedtables,
smtp,
ssl_certs,
ssl_config,
stats,
streams,
streamwrapper,
strformat,
strmisc,
strscans,
strtabs,
strutils,
sugar,
tables,
terminal,
threadpool,
times,
typeinfo,
typetraits,
unicode,
unidecode,
unittest,
uri,
volatile,
winlean,
xmlparser,
xmltree

import experimental/[
diff,
]

import packages/docutils/[
highlite,
rst,
rstast,
rstgen,
]

import std/[
compilesettings,
decls,
editdistance,
effecttraits,
enumerate,
enumutils,
exitprocs,
isolation,
jsonutils,
logic,
monotimes,
packedsets,
setutils,
sha1,
socketstreams,
stackframes,
sums,
time_t,
varints,
with,
wordwrap,
wrapnils,
]

import std/private/[
asciitables,
decode_helpers,
gitutils,
globs,
miscdollars,
since,
strimpl,
underscored_calls,
]
21 changes: 21 additions & 0 deletions tests/effects/tstrict_funcs_imports_js.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
discard """
cmd: "nim $target $options --hints:on --experimental:strictFuncs --experimental:views $file"
targets: "js"
"""
{.warning[UnusedImport]: off.}

import
asyncjs,
dom,
dom_extensions,
jsconsole,
jsffi,
jsre

import std/[
jsbigints,
]

import std/private/[
jsutils,
]