Skip to content

Commit

Permalink
test for multiple imports in 1 statement
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Dec 5, 2020
1 parent 803dbb1 commit e7fd8ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions tests/privateimports/mt8.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#[
test multiple imports
]#

{.push experimental: "allowPrivateImport".}
import ./m1, m2 {.privateImport.}, ./m3 {.privateImport.}

# m1 is regularly imported
doAssert declared(m1.foo0)
doAssert declared(foo0)
doAssert not declared(m1.foo1)

# m2
doAssert declared(m2.bar2)
doAssert declared(bar2)

# m3
doAssert declared(m3.car2)
doAssert declared(car2)
4 changes: 3 additions & 1 deletion tests/privateimports/tmain.nim
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import "."/[mt0,mt1,mt2,mt3,mt4,mt4b,mt5,mt6,mt7]
{.warning[UnusedImport]: off.}
# only import `mt*.nim` here; these depend on `m*.nim`
import "."/[mt0,mt1,mt2,mt3,mt4,mt4b,mt5,mt6,mt7,mt8]

0 comments on commit e7fd8ff

Please sign in to comment.