Skip to content

Commit

Permalink
PathFragment: test Windows mixed separator
Browse files Browse the repository at this point in the history
On Windows, if a user were to specify a PathFragment with mixed
separator such as

```
bazel build --profile='C:/foo\\bar' //...
```

then the profile file will be written as `bar` and recorded in
BuildToolLogs event as so.

Provide a test that demonstrates the current behavior to discuss whether
this is "correct" or not.
  • Loading branch information
sluongng committed May 13, 2024
1 parent 73b0faf commit e4a2a36
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public void testBasenameWindows() throws Exception {
assertThat(create("C:/foo").getBaseName()).isEqualTo("foo");
// Never return the drive name as a basename.
assertThat(create("C:/").getBaseName()).isEmpty();
// Mix usage of Windows and Unix separator is valid
assertThat(create("C:/foo\\bar").getBaseName()).isEqualTo("bar");
}

@Test
Expand Down

0 comments on commit e4a2a36

Please sign in to comment.