summary refs log tree commit diff stats
path: root/tests/nimble
diff options
context:
space:
mode:
Diffstat (limited to 'tests/nimble')
-rw-r--r--tests/nimble/tnimblepathdollar.nim7
-rw-r--r--tests/nimble/tnimblepathdollar.nims5
-rw-r--r--tests/nimble/tnimblepathdollar_fault.nim13
-rw-r--r--tests/nimble/tnimblepathdollar_fault.nims5
4 files changed, 30 insertions, 0 deletions
diff --git a/tests/nimble/tnimblepathdollar.nim b/tests/nimble/tnimblepathdollar.nim
new file mode 100644
index 000000000..994d975bb
--- /dev/null
+++ b/tests/nimble/tnimblepathdollar.nim
@@ -0,0 +1,7 @@
+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"
diff --git a/tests/nimble/tnimblepathdollar.nims b/tests/nimble/tnimblepathdollar.nims
new file mode 100644
index 000000000..9621fb29f
--- /dev/null
+++ b/tests/nimble/tnimblepathdollar.nims
@@ -0,0 +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")
diff --git a/tests/nimble/tnimblepathdollar_fault.nim b/tests/nimble/tnimblepathdollar_fault.nim
new file mode 100644
index 000000000..3f0270123
--- /dev/null
+++ b/tests/nimble/tnimblepathdollar_fault.nim
@@ -0,0 +1,13 @@
+discard """
+  errormsg: "cannot open file: pkgA/module"
+"""
+
+# see nims file; comment out `switch("noNimblePath")` there and there would be no error
+
+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"
diff --git a/tests/nimble/tnimblepathdollar_fault.nims b/tests/nimble/tnimblepathdollar_fault.nims
new file mode 100644
index 000000000..7d47da744
--- /dev/null
+++ b/tests/nimble/tnimblepathdollar_fault.nims
@@ -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")