move prelude so that include std/prelude also works (#17110)

* move prelude so that `include std/prelude` also works

* add test
This commit is contained in:
Timothee Cour 2021-02-20 09:08:13 -08:00 • committed by GitHub
commit e94a3e5fcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 28 additions and 11 deletions

14
tests/stdlib/tprelude.nim Normal file
View file

@ -0,0 +1,14 @@
discard """
targets: "c js"
matrix: "; -d:nimTestTpreludeCase1"
"""
when defined nimTestTpreludeCase1:
include std/prelude
else:
include prelude
template main() =
doAssert toSeq(1..3) == @[1,2,3]
static: main()
main()