2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-11-27 05:43:25 +00:00

Add absolute path tests for Windows (#230)

This commit is contained in:
Bor Kae Hwang 2020-02-06 09:54:31 -07:00 committed by GitHub
parent 1c5ed0706a
commit 2d4c9528e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,12 +78,18 @@ def _is_absolute_test(ctx):
asserts.false(env, paths.is_absolute("foo/"))
asserts.false(env, paths.is_absolute("foo/bar"))
# Try some absolute paths.
# Try some Linux absolute paths.
asserts.true(env, paths.is_absolute("/"))
asserts.true(env, paths.is_absolute("/foo"))
asserts.true(env, paths.is_absolute("/foo/"))
asserts.true(env, paths.is_absolute("/foo/bar"))
# Try some Windows absolute paths.
asserts.true(env, paths.is_absolute("D:\\"))
asserts.true(env, paths.is_absolute("C:\\"))
asserts.true(env, paths.is_absolute("C:\\foo"))
asserts.true(env, paths.is_absolute("C:\\foo\\bar"))
return unittest.end(env)
is_absolute_test = unittest.make(_is_absolute_test)