@@ -1240,10 +1240,13 @@ class TestNSString: LoopbackServerTest {
1240
1240
XCTAssertEqual ( " abcba " . commonPrefix ( with: " abcde " ) , " abc " )
1241
1241
XCTAssertEqual ( " /path/to/file1 " . commonPrefix ( with: " /path/to/file2 " ) , " /path/to/file " )
1242
1242
XCTAssertEqual ( " /a_really_long_path/to/a/file " . commonPrefix ( with: " /a_really_long_path/to/the/file " ) , " /a_really_long_path/to/ " )
1243
- XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " Mädchenschule " ) , " Ma \u{308} dchen " )
1244
1243
XCTAssertEqual ( " this " . commonPrefix ( with: " THAT " , options: [ . caseInsensitive] ) , " th " )
1245
- XCTAssertEqual ( " this " . commonPrefix ( with: " THAT " , options: [ . caseInsensitive, . literal] ) , " th " )
1246
- XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " Mädchenschule " , options: [ . literal] ) , " M " )
1244
+
1245
+ // Both forms of ä, a\u{308} decomposed and \u{E4} precomposed, should match without .literal and not match when .literal is used
1246
+ XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " ) , " Ma \u{308} dchen " )
1247
+ XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . literal] ) , " M " )
1248
+ XCTAssertEqual ( " m \u{E4} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . caseInsensitive, . literal] ) , " mädchen " )
1249
+ XCTAssertEqual ( " ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . caseInsensitive, . literal] ) , " m " )
1247
1250
}
1248
1251
}
1249
1252
0 commit comments