-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f0f5b3
commit 26ca9ef
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
discard """ | ||
cmd: "nim $target --os:windows --compileonly $file" | ||
action: compile | ||
disabled: windows # so that test runs on posix host but windows target | ||
""" | ||
|
||
# xxx add a way to test this at RT to make sure windows semantics are used. | ||
|
||
import os, strutils | ||
|
||
proc main() = | ||
doAssert not defined(posix) | ||
doAssert defined(windows) | ||
doAssert "foo" / "bar" == "foo/bar" | ||
const s = currentSourcePath | ||
doAssert '\\' notin s | ||
doAssert '/' in s | ||
doAssert DirSep == '/' | ||
let s2 = currentSourcePath | ||
doAssert s2 == s | ||
let s3 = s2.parentDir / "baz" | ||
doAssert s3.endsWith "tests/misc/baz" | ||
doAssert s3.isAbsolute | ||
|
||
static: main() | ||
main() | ||
# the doAsserts inside here would need to be adjusted, this is just used | ||
# to make sure it compiles without `static` |