-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Azure path comparison when filePath is root ("/") (#385)
* Fix Azure path comparison * Address comments * Formatting
- Loading branch information
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,22 @@ public void testCrossSchemeComparisons() { | |
Assertions.assertThat(abfsLocation.isChildOf(wasbLocation)).isTrue(); | ||
} | ||
|
||
@Test | ||
public void testLocationComparisons() { | ||
StorageLocation location = | ||
AzureLocation.of("abfss://[email protected]/some_file/metadata"); | ||
StorageLocation parentLocation = | ||
AzureLocation.of("abfss://[email protected]"); | ||
StorageLocation parentLocationTrailingSlash = | ||
AzureLocation.of("abfss://[email protected]/"); | ||
|
||
Assertions.assertThat(location).isNotEqualTo(parentLocation); | ||
Assertions.assertThat(location).isNotEqualTo(parentLocationTrailingSlash); | ||
|
||
Assertions.assertThat(location.isChildOf(parentLocation)).isTrue(); | ||
Assertions.assertThat(location.isChildOf(parentLocationTrailingSlash)).isTrue(); | ||
} | ||
|
||
@Test | ||
public void testLocation_negative_cases() { | ||
Assertions.assertThatThrownBy( | ||
|