* Fix #20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
This commit is contained in:
parent
e68a6ea759
commit
779b1cc5be
7 changed files with 41 additions and 38 deletions
|
|
@ -127,11 +127,11 @@ proc testGetFileInfo =
|
|||
echo pcLinkToDir
|
||||
echo pcLinkToFile
|
||||
|
||||
doAssert dirInfo.isRegular == true
|
||||
doAssert fileInfo.isRegular == true
|
||||
doAssert dirInfo.isSpecial == false
|
||||
doAssert fileInfo.isSpecial == false
|
||||
when defined(posix):
|
||||
doAssert linkDirInfo.isRegular == true
|
||||
doAssert linkFileInfo.isRegular == true
|
||||
doAssert linkDirInfo.isSpecial == false
|
||||
doAssert linkFileInfo.isSpecial == false
|
||||
|
||||
removeDir(dirPath)
|
||||
removeFile(filePath)
|
||||
|
|
@ -139,7 +139,7 @@ proc testGetFileInfo =
|
|||
removeFile(linkDirPath)
|
||||
removeFile(linkFilePath)
|
||||
|
||||
# Test that `isRegular` is set correctly
|
||||
# Test that `isSpecial` is set correctly
|
||||
block:
|
||||
when defined(posix):
|
||||
let
|
||||
|
|
@ -154,8 +154,8 @@ proc testGetFileInfo =
|
|||
fifoInfo = getFileInfo(fifoPath)
|
||||
linkFifoInfo = getFileInfo(linkFifoPath)
|
||||
|
||||
doAssert fifoInfo.isRegular == false
|
||||
doAssert linkFifoInfo.isRegular == false
|
||||
doAssert fifoInfo.isSpecial == true
|
||||
doAssert linkFifoInfo.isSpecial == true
|
||||
|
||||
removeFile(fifoPath)
|
||||
removeFile(linkFifoPath)
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ block: # walkDir
|
|||
removeDir("walkdir_test")
|
||||
|
||||
when defined(posix):
|
||||
block walkDirRegular:
|
||||
block walkDirSpecial:
|
||||
createDir("walkdir_test")
|
||||
doAssert execShellCmd("mkfifo walkdir_test/fifo") == 0
|
||||
createSymlink("fifo", "walkdir_test/fifo_link")
|
||||
|
|
@ -370,9 +370,9 @@ block: # walkDir
|
|||
(pcFile, "fifo") in withSpecialFiles and
|
||||
(pcLinkToFile, "fifo_link") in withSpecialFiles)
|
||||
# now Unix special files are excluded from walkdir output:
|
||||
let onlyRegularFiles = toSeq(walkDir("walkdir_test", relative = true,
|
||||
onlyRegular = true))
|
||||
doAssert onlyRegularFiles.len == 0
|
||||
let skipSpecialFiles = toSeq(walkDir("walkdir_test", relative = true,
|
||||
skipSpecial = true))
|
||||
doAssert skipSpecialFiles.len == 0
|
||||
removeDir("walkdir_test")
|
||||
|
||||
block normalizedPath:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue