summary refs log tree commit diff stats
path: root/tests/vm/tvmmisc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vm/tvmmisc.nim')
-rw-r--r--tests/vm/tvmmisc.nim24
1 files changed, 21 insertions, 3 deletions
diff --git a/tests/vm/tvmmisc.nim b/tests/vm/tvmmisc.nim
index 42a58fa8f..472660bc2 100644
--- a/tests/vm/tvmmisc.nim
+++ b/tests/vm/tvmmisc.nim
@@ -1,5 +1,8 @@
 # bug #4462
 import macros
+import os
+import ospaths
+import strutils
 
 block:
   proc foo(t: typedesc) {.compileTime.} =
@@ -18,7 +21,7 @@ block:
 # #6379
 static:
   import algorithm
-  
+
   var numArray = [1, 2, 3, 4, -1]
   numArray.sort(cmp)
   assert numArray == [-1, 1, 2, 3, 4]
@@ -57,10 +60,25 @@ block:
     result = @[0]
     result.setLen(2)
     var tmp: int
-      
-    for i in 0 .. <2:
+
+    for i in 0 ..< 2:
       inc tmp
       result[i] = tmp
 
   const fact1000 = abc()
   assert fact1000 == @[1, 2]
+
+# Tests for VM ops
+block:
+  static:
+    assert "vm" in getProjectPath()
+
+    let b = getEnv("UNSETENVVAR")
+    assert b == ""
+    assert existsEnv("UNSERENVVAR") == false
+    putEnv("UNSETENVVAR", "VALUE")
+    assert getEnv("UNSETENVVAR") == "VALUE"
+    assert existsEnv("UNSETENVVAR") == true
+
+    assert fileExists("MISSINGFILE") == false
+    assert dirExists("MISSINGDIR") == false