Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
genotrance authored and alehander92 committed Dec 2, 2019
1 parent c7db8e3 commit 3cf73b6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 2 additions & 0 deletions compiler/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,11 @@ proc removeTrailingDirSep*(path: string): string =
proc disableNimblePath*(conf: ConfigRef) =
incl conf.globalOptions, optNoNimblePath
conf.lazyPaths.setLen(0)
conf.nimblePaths.setLen(0)

proc clearNimblePath*(conf: ConfigRef) =
conf.lazyPaths.setLen(0)
conf.nimblePaths.setLen(0)

include packagehandling

Expand Down
2 changes: 1 addition & 1 deletion tests/nimble/tnimblepathdollar.nims
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
switch("clearNimblePath")
switch("nimblePath", "$projectdir/nimbleDir/simplePkgs")
switch("path", "$nimblepath/pkgA-0.1.0")
switch("path", "$nimblepath/pkgB-#head")
switch("path", "$nimblepath/pkgC-#head")
switch("noNimblePath")
10 changes: 10 additions & 0 deletions tests/nimble/tnimblepathdollarfail.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
discard """
errmsg: "cannot open file: pkgA/module"
"""
import pkgA/module as A
import pkgB/module as B
import pkgC/module as C

doAssert pkgATest() == 1, "Simple pkgA-0.1.0 wasn't added to path correctly."
doAssert pkgBTest() == 0xDEADBEEF, "pkgB-#head wasn't picked over pkgB-0.1.0"
doAssert pkgCTest() == 0xDEADBEEF, "pkgC-#head wasn't picked over pkgC-#aa11"
5 changes: 5 additions & 0 deletions tests/nimble/tnimblepathdollarfail.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
switch("noNimblePath")
switch("nimblePath", "$projectdir/nimbleDir/simplePkgs")
switch("path", "$nimblepath/pkgA-0.1.0")
switch("path", "$nimblepath/pkgB-#head")
switch("path", "$nimblepath/pkgC-#head")

0 comments on commit 3cf73b6

Please sign in to comment.