From 2d4c9528e0f453b5950eeaeac11d8d09f5a504d4 Mon Sep 17 00:00:00 2001 From: Bor Kae Hwang Date: Thu, 6 Feb 2020 09:54:31 -0700 Subject: [PATCH] Add absolute path tests for Windows (#230) --- tests/paths_tests.bzl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/paths_tests.bzl b/tests/paths_tests.bzl index aaf3e3e..42253d8 100644 --- a/tests/paths_tests.bzl +++ b/tests/paths_tests.bzl @@ -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)