summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorAnatoly Galiulin <galiulin.anatoly@gmail.com>2015-07-21 09:58:26 +0600
committerAnatoly Galiulin <galiulin.anatoly@gmail.com>2015-07-21 09:58:26 +0600
commit506b90cea87028f18ca66f5088274423c4e46202 (patch)
tree83a7e8b2132e6976e245b4086311cfc1d3aa23f7 /tests/vm
parent6b001609384876e4421e3550ba91770fd2e2b52e (diff)
downloadNim-506b90cea87028f18ca66f5088274423c4e46202.tar.gz
Added absolute path support to options.findFile
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tslurp.nim10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/vm/tslurp.nim b/tests/vm/tslurp.nim
index f9456ce6b..fc3dc6f0a 100644
--- a/tests/vm/tslurp.nim
+++ b/tests/vm/tslurp.nim
@@ -1,6 +1,12 @@
+import os
+
+template getScriptDir(): string =
+  parentDir(instantiationInfo(-1, true).filename)
 
 const
-  myRes = slurp"../../readme.txt"
+  relRes = slurp"../../readme.txt"
+  absRes = slurp(parentDir(parentDir(getScriptDir())) / "readme.txt")
   
-echo myRes
+echo relRes
+echo absRes
 
47'>147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209