mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 14:00:35 +00:00
* Fix #20628 for Windows * Move isRegular - !isSpecial and onlyRegular - skipSpecial * Forgot to change it in 1 more place
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user