diff options
author | Araq <rumpf_a@web.de> | 2016-12-13 09:01:53 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2016-12-13 09:01:53 +0100 |
commit | 7f8a02d0c64ce6d7fc8da6201941e244125bbfa3 (patch) | |
tree | e98d0e3d4fa65cd5b91eb40609bdf289422690b9 /tests/stdlib/tos.nim | |
parent | 5c6a4d9e9047ad58bb5511e96e4502ff7da1281c (diff) | |
download | Nim-7f8a02d0c64ce6d7fc8da6201941e244125bbfa3.tar.gz |
make tos.nim green on Windows
Diffstat (limited to 'tests/stdlib/tos.nim')
-rw-r--r-- | tests/stdlib/tos.nim | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/stdlib/tos.nim b/tests/stdlib/tos.nim index 1ef02f97e..4df02a9e2 100644 --- a/tests/stdlib/tos.nim +++ b/tests/stdlib/tos.nim @@ -43,7 +43,7 @@ Raises """ # test os path creation, iteration, and deletion -import os +import os, strutils let files = @["these.txt", "are.x", "testing.r", "files.q"] let dirs = @["some", "created", "test", "dirs"] @@ -65,18 +65,21 @@ for file in files: echo "All:" +template norm(x): untyped = + (when defined(windows): x.replace('\\', '/') else: x) + for path in walkPattern(dname/"*"): - echo path + echo path.norm echo "Files:" for path in walkFiles(dname/"*"): - echo path + echo path.norm echo "Dirs:" for path in walkDirs(dname/"*"): - echo path + echo path.norm # Test removal of files dirs for dir in dirs: |