EnvironmentUtil.setOperatingSystem(operatingSystem);
// Test 1: For a file called 'A black\white telephone ☎.jpg'
// Note: "A black" is NOT a directory, it's part of the filename (invalid on Windows!)
String alreadyNormalizedRelativePathFileStr = "Pictures/A black\\white telephone ☎.jpg";
NormalizedPath normalizedPathFile = new NormalizedPath(null, alreadyNormalizedRelativePathFileStr);
assertEquals("Pictures/A black\\white telephone ☎.jpg", normalizedPathFile.toString());
assertEquals("Pictures", normalizedPathFile.getParent().toString());
// Test 2: For directory called 'black\\white telephones ☎'
String alreadyNormalizedRelativePathDirStr = "Pictures/black\\white telephones ☎";
NormalizedPath normalizedPathDir = new NormalizedPath(null, alreadyNormalizedRelativePathDirStr);
assertEquals("Pictures/black\\white telephones ☎", normalizedPathDir.toString());
assertEquals("Pictures", normalizedPathDir.getParent().toString());
// Test 3: For directory called 'black\\white telephones ☎'
String alreadyNormalizedRelativePathFileWithBackslashesDirStr = "Pictures/Black\\White Pictures/Mostly\\Black Pictures/blacky.jpg";
NormalizedPath normalizedPathWithBackslashesDir = new NormalizedPath(null, alreadyNormalizedRelativePathFileWithBackslashesDirStr);
assertEquals("Pictures/Black\\White Pictures/Mostly\\Black Pictures/blacky.jpg", normalizedPathWithBackslashesDir.toString());
assertEquals("Pictures/Black\\White Pictures/Mostly\\Black Pictures", normalizedPathWithBackslashesDir.getParent().toString());
}