use doAssert in tests (#16486)
This commit is contained in:
parent
f9a15dbae9
commit
6d442a40a6
78 changed files with 1056 additions and 1056 deletions
|
|
@ -51,56 +51,56 @@ doAssert(existsEnv("dummy") == false)
|
|||
# issue #7393
|
||||
let wd = getCurrentDir()
|
||||
cd("..")
|
||||
assert wd != getCurrentDir()
|
||||
doAssert wd != getCurrentDir()
|
||||
cd(wd)
|
||||
assert wd == getCurrentDir()
|
||||
doAssert wd == getCurrentDir()
|
||||
|
||||
when false:
|
||||
# this doesn't work in a 'koch testintall' environment
|
||||
assert findExe("nim") != ""
|
||||
doAssert findExe("nim") != ""
|
||||
|
||||
# general tests
|
||||
mode = ScriptMode.Verbose
|
||||
|
||||
assert getCommand() == "c"
|
||||
doAssert getCommand() == "c"
|
||||
setCommand("cpp")
|
||||
assert getCommand() == "cpp"
|
||||
doAssert getCommand() == "cpp"
|
||||
setCommand("c")
|
||||
|
||||
assert cmpic("HeLLO", "hello") == 0
|
||||
doAssert cmpic("HeLLO", "hello") == 0
|
||||
|
||||
assert fileExists("tests/newconfig/tfoo.nims") == true
|
||||
assert dirExists("tests") == true
|
||||
doAssert fileExists("tests/newconfig/tfoo.nims") == true
|
||||
doAssert dirExists("tests") == true
|
||||
|
||||
assert fileExists("tests/newconfig/tfoo.nims") == true
|
||||
assert dirExists("tests") == true
|
||||
doAssert fileExists("tests/newconfig/tfoo.nims") == true
|
||||
doAssert dirExists("tests") == true
|
||||
|
||||
discard selfExe()
|
||||
|
||||
when defined(windows):
|
||||
assert toExe("nim") == "nim.exe"
|
||||
assert toDll("nim") == "nim.dll"
|
||||
doAssert toExe("nim") == "nim.exe"
|
||||
doAssert toDll("nim") == "nim.dll"
|
||||
else:
|
||||
assert toExe("nim") == "nim"
|
||||
assert toDll("nim") == "libnim.so"
|
||||
doAssert toExe("nim") == "nim"
|
||||
doAssert toDll("nim") == "libnim.so"
|
||||
|
||||
rmDir("tempXYZ")
|
||||
doAssertRaises(OSError):
|
||||
rmDir("tempXYZ", checkDir = true)
|
||||
assert dirExists("tempXYZ") == false
|
||||
doAssert dirExists("tempXYZ") == false
|
||||
mkDir("tempXYZ")
|
||||
assert dirExists("tempXYZ") == true
|
||||
assert fileExists("tempXYZ/koch.nim") == false
|
||||
doAssert dirExists("tempXYZ") == true
|
||||
doAssert fileExists("tempXYZ/koch.nim") == false
|
||||
|
||||
when false:
|
||||
# this doesn't work in a 'koch testintall' environment
|
||||
cpFile("koch.nim", "tempXYZ/koch.nim")
|
||||
assert fileExists("tempXYZ/koch.nim") == true
|
||||
doAssert fileExists("tempXYZ/koch.nim") == true
|
||||
cpDir("nimsuggest", "tempXYZ/.")
|
||||
assert dirExists("tempXYZ/tests") == true
|
||||
assert fileExists("tempXYZ/nimsuggest.nim") == true
|
||||
doAssert dirExists("tempXYZ/tests") == true
|
||||
doAssert fileExists("tempXYZ/nimsuggest.nim") == true
|
||||
rmFile("tempXYZ/koch.nim")
|
||||
assert fileExists("tempXYZ/koch.nim") == false
|
||||
doAssert fileExists("tempXYZ/koch.nim") == false
|
||||
|
||||
rmDir("tempXYZ")
|
||||
assert dirExists("tempXYZ") == false
|
||||
doAssert dirExists("tempXYZ") == false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue