make tos.nim green on Windows
This commit is contained in:
parent
5c6a4d9e90
commit
7f8a02d0c6
1 changed files with 7 additions and 4 deletions
|
|
@ -43,7 +43,7 @@ Raises
|
||||||
"""
|
"""
|
||||||
# test os path creation, iteration, and deletion
|
# test os path creation, iteration, and deletion
|
||||||
|
|
||||||
import os
|
import os, strutils
|
||||||
|
|
||||||
let files = @["these.txt", "are.x", "testing.r", "files.q"]
|
let files = @["these.txt", "are.x", "testing.r", "files.q"]
|
||||||
let dirs = @["some", "created", "test", "dirs"]
|
let dirs = @["some", "created", "test", "dirs"]
|
||||||
|
|
@ -65,18 +65,21 @@ for file in files:
|
||||||
|
|
||||||
echo "All:"
|
echo "All:"
|
||||||
|
|
||||||
|
template norm(x): untyped =
|
||||||
|
(when defined(windows): x.replace('\\', '/') else: x)
|
||||||
|
|
||||||
for path in walkPattern(dname/"*"):
|
for path in walkPattern(dname/"*"):
|
||||||
echo path
|
echo path.norm
|
||||||
|
|
||||||
echo "Files:"
|
echo "Files:"
|
||||||
|
|
||||||
for path in walkFiles(dname/"*"):
|
for path in walkFiles(dname/"*"):
|
||||||
echo path
|
echo path.norm
|
||||||
|
|
||||||
echo "Dirs:"
|
echo "Dirs:"
|
||||||
|
|
||||||
for path in walkDirs(dname/"*"):
|
for path in walkDirs(dname/"*"):
|
||||||
echo path
|
echo path.norm
|
||||||
|
|
||||||
# Test removal of files dirs
|
# Test removal of files dirs
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue