Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bazelbuild/bazel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e74a1c083bd761ac15fc02e014965977edd12508
Choose a base ref
..
head repository: bazelbuild/bazel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c90c146446f2b59901b313c4e083b3143936ecb2
Choose a head ref
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/test/java/com/google/devtools/build/lib/vfs/PathFragmentWindowsTest.java
Original file line number Diff line number Diff line change
@@ -177,6 +177,9 @@ public void testGetParentDirectoryWindows() {
public void testSegmentsCountWindows() {
assertThat(create("C:/foo").segmentCount()).isEqualTo(1);
assertThat(create("C:/").segmentCount()).isEqualTo(0);
// Mix usage of Windows and Unix separator is valid
assertThat(create("C:/foo\\bar").segmentCount()).isEqualTo(2);
assertThat(create("C:\\foo\\bar/baz").segmentCount()).isEqualTo(3);
}

@Test
@@ -185,6 +188,12 @@ public void testGetSegmentWindows() {
assertThat(create("C:/foo/bar").getSegment(1)).isEqualTo("bar");
assertThat(create("C:/foo/").getSegment(0)).isEqualTo("foo");
assertThat(create("C:/foo").getSegment(0)).isEqualTo("foo");
// Mix usage of Windows and Unix separator is valid
assertThat(create("C:/foo\\bar").getSegment(0)).isEqualTo("foo");
assertThat(create("C:/foo\\bar").getSegment(1)).isEqualTo("bar");
assertThat(create("C:\\foo\\bar/baz").getSegment(0)).isEqualTo("foo");
assertThat(create("C:\\foo\\bar/baz").getSegment(1)).isEqualTo("bar");
assertThat(create("C:\\foo\\bar/baz").getSegment(2)).isEqualTo("baz");
}

@Test