* follow up #18517 * Update lib/pure/os.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * Update lib/pure/os.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
This commit is contained in:
parent
dbf8d0b894
commit
a8b3e7c059
1 changed files with 3 additions and 2 deletions
|
|
@ -11,10 +11,11 @@
|
||||||
## retrieving environment variables, reading command line arguments,
|
## retrieving environment variables, reading command line arguments,
|
||||||
## working with directories, running shell commands, etc.
|
## working with directories, running shell commands, etc.
|
||||||
|
|
||||||
runnableExamples("-r:off"):
|
runnableExamples:
|
||||||
let myFile = "/path/to/my/file.nim"
|
let myFile = "/path/to/my/file.nim"
|
||||||
assert splitPath(myFile) == (head: "/path/to/my", tail: "file.nim")
|
assert splitPath(myFile) == (head: "/path/to/my", tail: "file.nim")
|
||||||
assert parentDir(myFile) == "/path/to/my"
|
when defined(posix):
|
||||||
|
assert parentDir(myFile) == "/path/to/my"
|
||||||
assert splitFile(myFile) == (dir: "/path/to/my", name: "file", ext: ".nim")
|
assert splitFile(myFile) == (dir: "/path/to/my", name: "file", ext: ".nim")
|
||||||
assert myFile.changeFileExt("c") == "/path/to/my/file.c"
|
assert myFile.changeFileExt("c") == "/path/to/my/file.c"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue