Implemented flags and arguments for NimScript's setCommand.
This commit is contained in:
parent
5eaee85825
commit
84f371982b
6 changed files with 249 additions and 82 deletions
|
|
@ -13,3 +13,10 @@ requires "nim >= 0.12.1"
|
|||
|
||||
task test, "test description":
|
||||
echo(5+5)
|
||||
|
||||
task c_test, "Testing `setCommand \"c\", \"nimscript.nim\"`":
|
||||
setCommand "c", "nimscript.nim"
|
||||
|
||||
task cr, "Testing `nimble c -r nimscript.nim` via setCommand":
|
||||
--r
|
||||
setCommand "c", "nimscript.nim"
|
||||
|
|
@ -29,10 +29,25 @@ test "can execute nimscript tasks":
|
|||
check exitCode == QuitSuccess
|
||||
check lines[^1] == "10"
|
||||
|
||||
test "can use nimscript's setCommand":
|
||||
cd "nimscript":
|
||||
let (output, exitCode) = execCmdEx("../" & path & " cTest")
|
||||
let lines = output.strip.splitLines()
|
||||
check exitCode == QuitSuccess
|
||||
check "Hint: operation successful".normalize in lines[^1].normalize
|
||||
|
||||
test "can use nimscript's setCommand with flags":
|
||||
cd "nimscript":
|
||||
let (output, exitCode) = execCmdEx("../" & path & " cr")
|
||||
let lines = output.strip.splitLines()
|
||||
check exitCode == QuitSuccess
|
||||
check "Hint: operation successful".normalize in lines[^2].normalize
|
||||
check "Hello World".normalize in lines[^1].normalize
|
||||
|
||||
test "can list nimscript tasks":
|
||||
cd "nimscript":
|
||||
let (output, exitCode) = execCmdEx("../" & path & " tasks")
|
||||
check output.strip == "test test description"
|
||||
check "test test description".normalize in output.normalize
|
||||
check exitCode == QuitSuccess
|
||||
|
||||
test "can install packagebin2":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue