@@ -1217,10 +1217,13 @@ class TestNSString: LoopbackServerTest {
1217
1217
XCTAssertEqual ( " abcba " . commonPrefix ( with: " abcde " ) , " abc " )
1218
1218
XCTAssertEqual ( " /path/to/file1 " . commonPrefix ( with: " /path/to/file2 " ) , " /path/to/file " )
1219
1219
XCTAssertEqual ( " /a_really_long_path/to/a/file " . commonPrefix ( with: " /a_really_long_path/to/the/file " ) , " /a_really_long_path/to/ " )
1220
- XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " Mädchenschule " ) , " Ma \u{308} dchen " )
1221
1220
XCTAssertEqual ( " this " . commonPrefix ( with: " THAT " , options: [ . caseInsensitive] ) , " th " )
1222
- XCTAssertEqual ( " this " . commonPrefix ( with: " THAT " , options: [ . caseInsensitive, . literal] ) , " th " )
1223
- XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " Mädchenschule " , options: [ . literal] ) , " M " )
1221
+
1222
+ // Both forms of ä, a\u{308} decomposed and \u{E4} precomposed, should match without .literal and not match when .literal is used
1223
+ XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " ) , " Ma \u{308} dchen " )
1224
+ XCTAssertEqual ( " Ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . literal] ) , " M " )
1225
+ XCTAssertEqual ( " m \u{E4} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . caseInsensitive, . literal] ) , " mädchen " )
1226
+ XCTAssertEqual ( " ma \u{308} dchen " . commonPrefix ( with: " M \u{E4} dchenschule " , options: [ . caseInsensitive, . literal] ) , " m " )
1224
1227
}
1225
1228
}
1226
1229
0 commit comments