diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-07-02 07:19:13 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 16:19:13 +0200 |
commit | dc5a40f3f39c6ea672e6dc6aca7f8118a69dda99 (patch) | |
tree | 5565f50d66e33272624093268d0c8641c770f59e /tests | |
parent | 366b9a7e4a067cece3b1215de7fb4dffc703e88a (diff) | |
download | Nim-dc5a40f3f39c6ea672e6dc6aca7f8118a69dda99.tar.gz |
{.deprecated: [existsFile: fileExists].} (#14735)
* {.deprecated: [existsFile: fileExists].} * s/existsFile/fileExists/ except under deps * workaround pending #14819 * fix test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/manyloc/keineschweine/dependencies/nake/nake.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/enet_server/enet_server.nim | 4 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/lib/client_helpers.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/lib/sg_assets.nim | 4 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/server/old_dirserver.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/keineschweine/server/old_sg_server.nim | 4 | ||||
-rw-r--r-- | tests/manyloc/nake/nake.nim | 2 | ||||
-rw-r--r-- | tests/manyloc/nake/nakefile.nim | 2 | ||||
-rw-r--r-- | tests/misc/trunner.nim | 2 | ||||
-rw-r--r-- | tests/newconfig/tfoo.nims | 2 | ||||
-rw-r--r-- | tests/stdlib/tgetfileinfo.nim | 2 | ||||
-rw-r--r-- | tests/test_nimscript.nims | 1 |
12 files changed, 14 insertions, 15 deletions
diff --git a/tests/manyloc/keineschweine/dependencies/nake/nake.nim b/tests/manyloc/keineschweine/dependencies/nake/nake.nim index 83569e30e..bc380986f 100644 --- a/tests/manyloc/keineschweine/dependencies/nake/nake.nim +++ b/tests/manyloc/keineschweine/dependencies/nake/nake.nim @@ -51,7 +51,7 @@ template withDir*(dir: string; body: stmt): stmt = cd(curDir) when true: - if not existsFile("nakefile.nim"): + if not fileExists("nakefile.nim"): echo "No nakefile.nim found. Current working dir is ", getCurrentDir() quit 1 var args = "" diff --git a/tests/manyloc/keineschweine/enet_server/enet_server.nim b/tests/manyloc/keineschweine/enet_server/enet_server.nim index 336e57755..794e1c843 100644 --- a/tests/manyloc/keineschweine/enet_server/enet_server.nim +++ b/tests/manyloc/keineschweine/enet_server/enet_server.nim @@ -118,7 +118,7 @@ when true: of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): zoneCfgFile = val else: echo("File does not exist: ", val) @@ -136,7 +136,7 @@ when true: address.port = port var path = getAppDir()/../"data"/zoneFile - if not existsFile(path): + if not fileExists(path): echo("Zone settings file does not exist: ../data/", zoneFile) echo(path) quit(1) diff --git a/tests/manyloc/keineschweine/lib/client_helpers.nim b/tests/manyloc/keineschweine/lib/client_helpers.nim index 5f74aef85..8c45feb62 100644 --- a/tests/manyloc/keineschweine/lib/client_helpers.nim +++ b/tests/manyloc/keineschweine/lib/client_helpers.nim @@ -127,7 +127,7 @@ proc handleFileChallenge*(serv: PServer; buffer: PBuffer) = challenge = readScFileChallenge(buffer) path = expandPath(challenge) resp: CsFileChallenge - if not existsFile(path): + if not fileExists(path): resp.needFile = true echo "Got file challenge, need file." else: diff --git a/tests/manyloc/keineschweine/lib/sg_assets.nim b/tests/manyloc/keineschweine/lib/sg_assets.nim index 7caa9c3fb..5929add43 100644 --- a/tests/manyloc/keineschweine/lib/sg_assets.nim +++ b/tests/manyloc/keineschweine/lib/sg_assets.nim @@ -221,7 +221,7 @@ template cacheImpl(procName, cacheName, resultType, body: untyped) {.dirty.} = cacheName[filename] = result template checkFile(path: untyped) {.dirty.} = - if not existsFile(path): + if not fileExists(path): errors.add("File missing: " & path) cacheImpl newSprite, SpriteSheets, PSpriteSheet: @@ -322,7 +322,7 @@ proc validateSettings*(settings: JsonNode, errors: var seq[string]): bool = inc id proc loadSettingsFromFile*(filename: string, errors: var seq[string]): bool = - if not existsFile(filename): + if not fileExists(filename): errors.add("File does not exist: "&filename) else: result = loadSettings(readFile(filename), errors) diff --git a/tests/manyloc/keineschweine/server/old_dirserver.nim b/tests/manyloc/keineschweine/server/old_dirserver.nim index 390b738aa..cd2b60b26 100644 --- a/tests/manyloc/keineschweine/server/old_dirserver.nim +++ b/tests/manyloc/keineschweine/server/old_dirserver.nim @@ -164,7 +164,7 @@ when true: of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): cfgFile = val else: echo("File does not exist: ", val) diff --git a/tests/manyloc/keineschweine/server/old_sg_server.nim b/tests/manyloc/keineschweine/server/old_sg_server.nim index 473880e2b..8bd44017e 100644 --- a/tests/manyloc/keineschweine/server/old_sg_server.nim +++ b/tests/manyloc/keineschweine/server/old_sg_server.nim @@ -149,7 +149,7 @@ when true: of cmdShortOption, cmdLongOption: case key of "f", "file": - if existsFile(val): + if fileExists(val): zoneCfgFile = val else: echo("File does not exist: ", val) @@ -165,7 +165,7 @@ when true: dirServerInfo = jsonSettings["dirserver"] var path = getAppDir()/../"data"/zoneFile - if not existsFile(path): + if not fileExists(path): echo("Zone settings file does not exist: ../data/", zoneFile) echo(path) quit(1) diff --git a/tests/manyloc/nake/nake.nim b/tests/manyloc/nake/nake.nim index ebcf21d19..87db5b54d 100644 --- a/tests/manyloc/nake/nake.nim +++ b/tests/manyloc/nake/nake.nim @@ -51,7 +51,7 @@ template withDir*(dir: string; body: untyped) = cd(curDir) when true: - if not existsFile("nakefile.nim"): + if not fileExists("nakefile.nim"): echo "No nakefile.nim found. Current working dir is ", getCurrentDir() quit 1 var args = "" diff --git a/tests/manyloc/nake/nakefile.nim b/tests/manyloc/nake/nakefile.nim index 91dd61726..1da92b76b 100644 --- a/tests/manyloc/nake/nakefile.nim +++ b/tests/manyloc/nake/nakefile.nim @@ -86,7 +86,7 @@ task "download", "download game assets": client = newHttpClient() path.add DirSep path.add(extractFilename(GameAssets)) - if existsFile(path): + if fileExists(path): echo "The file already exists\n", "[R]emove [M]ove [Q]uit [S]kip Source: ", GameAssets case stdin.readLine.toLowerAscii diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim index 382fd35ae..d67547d62 100644 --- a/tests/misc/trunner.nim +++ b/tests/misc/trunner.nim @@ -26,7 +26,7 @@ const proc runCmd(file, options = ""): auto = let fileabs = testsDir / file.unixToNativePath - doAssert fileabs.existsFile, fileabs + doAssert fileabs.fileExists, fileabs let cmd = fmt"{nim} {mode} {options} --hints:off {fileabs}" result = execCmdEx(cmd) when false: echo result[0] & "\n" & result[1] # for debugging diff --git a/tests/newconfig/tfoo.nims b/tests/newconfig/tfoo.nims index 4186ee047..fbff38f01 100644 --- a/tests/newconfig/tfoo.nims +++ b/tests/newconfig/tfoo.nims @@ -72,7 +72,7 @@ assert cmpic("HeLLO", "hello") == 0 assert fileExists("tests/newconfig/tfoo.nims") == true assert dirExists("tests") == true -assert existsFile("tests/newconfig/tfoo.nims") == true +assert fileExists("tests/newconfig/tfoo.nims") == true assert existsDir("tests") == true discard selfExe() diff --git a/tests/stdlib/tgetfileinfo.nim b/tests/stdlib/tgetfileinfo.nim index d5ccdea56..19de193e4 100644 --- a/tests/stdlib/tgetfileinfo.nim +++ b/tests/stdlib/tgetfileinfo.nim @@ -20,7 +20,7 @@ proc genBadFileName(limit = 100): string = var hitLimit = true for i in 0..100: - if existsFile(result): + if fileExists(result): result.add("a") else: hitLimit = false diff --git a/tests/test_nimscript.nims b/tests/test_nimscript.nims index 7c64ea762..1a6f26137 100644 --- a/tests/test_nimscript.nims +++ b/tests/test_nimscript.nims @@ -77,6 +77,5 @@ block: block: # #14142 discard existsDir("/usr") discard dirExists("/usr") - discard existsFile("/usr/foo") discard fileExists("/usr/foo") discard findExe("nim") |