summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-10-24 20:18:49 +0200
committerAraq <rumpf_a@web.de>2016-10-24 20:18:49 +0200
commita85e954b5d690b0305d2abaff04cd6d4098029f1 (patch)
tree7932d6fbb0a59b77d3c9a3dc8a576bd4f13a2bff /tests
parent6d645e52405326d65d0240b0e57eaca9462dfd11 (diff)
downloadNim-a85e954b5d690b0305d2abaff04cd6d4098029f1.tar.gz
make tgetfileinfo work on Windows
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tgetfileinfo.nim24
1 files changed, 16 insertions, 8 deletions
diff --git a/tests/stdlib/tgetfileinfo.nim b/tests/stdlib/tgetfileinfo.nim
index 780853afc..1c897b702 100644
--- a/tests/stdlib/tgetfileinfo.nim
+++ b/tests/stdlib/tgetfileinfo.nim
@@ -104,23 +104,31 @@ proc testGetFileInfo =
 
     createDir(dirPath)
     writeFile(filePath, "")
-    createSymlink(dirPath, linkDirPath)
-    createSymlink(filePath, linkFilePath)
+    when defined(posix):
+      createSymlink(dirPath, linkDirPath)
+      createSymlink(filePath, linkFilePath)
 
     let
       dirInfo = getFileInfo(dirPath)
       fileInfo = getFileInfo(filePath)
-      linkDirInfo = getFileInfo(linkDirPath, followSymlink = false)
-      linkFileInfo = getFileInfo(linkFilePath, followSymlink = false)
+    when defined(posix):
+      let
+        linkDirInfo = getFileInfo(linkDirPath, followSymlink = false)
+        linkFileInfo = getFileInfo(linkFilePath, followSymlink = false)
 
     echo dirInfo.kind
     echo fileInfo.kind
-    echo linkDirInfo.kind
-    echo linkFileInfo.kind
+    when defined(posix):
+      echo linkDirInfo.kind
+      echo linkFileInfo.kind
+    else:
+      echo pcLinkToDir
+      echo pcLinkToFile
 
     removeDir(dirPath)
     removeFile(filePath)
-    removeFile(linkDirPath)
-    removeFile(linkFilePath)
+    when defined(posix):
+      removeFile(linkDirPath)
+      removeFile(linkFilePath)
 
 testGetFileInfo()