Commit 2c320e9
committed
fix(test): make
The test was failing on Windows:
```
FAIL: testDestPathExt (__main__.DestPathTest.testDestPathExt)
AssertionError: '/bar/baz' != 'external/repo\\foo/bar/baz'
FAIL: testDestPathExtWrong (__main__.DestPathTest.testDestPathExtWrong)
AssertionError: 'external/repo/foo/bar/baz' != 'external/repo\\foo/bar/baz'
FAIL: testSafeShortPathExt (__main__.SafeShortPathTest.testSafeShortPathExt)
AssertionError: 'external/repo/foo/bar/baz' != 'external/repo\\foo/bar/baz'
FAIL: testSafeShortPathGenExt (__main__.SafeShortPathTest.testSafeShortPathGenExt)
AssertionError: 'external/repo/foo/bar/baz' != 'external/repo\\foo/bar/baz'
FAIL: testShortPathDirnameExt (__main__.ShortPathDirnameTest.testShortPathDirnameExt)
AssertionError: 'external/repo/foo/bar' != 'external/repo\\foo/bar'
FAIL: testShortPathDirnameGenExt (__main__.ShortPathDirnameTest.testShortPathDirnameGenExt)
AssertionError: 'external/repo/foo/bar' != 'external/repo\\foo/bar'
FAIL: testTopLevelExt (__main__.ShortPathDirnameTest.testTopLevelExt)
AssertionError: 'external/repo' != 'external'
```
The mock `File` class used `os.path.join()` which produces
platform-specific path separators (backslashes on Windows), which
doesn't match Bazel's behavior which always uses forward slashes
regardless of platform:
- use `posixpath.join()` instead,
- enable the test in Windows CI since it now passes.//tests:path_test work on Windows1 parent a9358d5 commit 2c320e9
2 files changed
Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | 51 | | |
53 | 52 | | |
54 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments