@@ -291,39 +291,35 @@ extension TestNSJSONSerialization {
291
291
}
292
292
293
293
func test_deserialize_unicodeEscapeSequence( ) {
294
- // DISABLED: changes for SE-128 have apparently changed the result of parsing
295
- // TODO: Investigate and re-enable test.
296
- /*
297
294
let subject = " [ \" \\ u2728 \" ] "
298
295
do {
299
296
guard let data = subject. data ( using: . utf8) else {
300
297
XCTFail ( " Unable to convert string to data " )
301
298
return
302
299
}
303
300
let result = try JSONSerialization . jsonObject ( with: data, options: [ ] ) as? [ Any ]
301
+ // result?[0] as? String returns an Optional<String> and RHS is promoted
302
+ // to Optional<String>
304
303
XCTAssertEqual ( result ? [ 0 ] as? String , " ✨ " )
305
304
} catch {
306
305
XCTFail ( " Unexpected error: \( error) " )
307
306
}
308
- */
309
307
}
310
308
311
309
func test_deserialize_unicodeSurrogatePairEscapeSequence( ) {
312
- // DISABLED: changes for SE-128 have apparently changed the result of parsing
313
- // TODO: Investigate and re-enable test.
314
- /*
315
310
let subject = " [ \" \\ uD834 \\ udd1E \" ] "
316
311
do {
317
312
guard let data = subject. data ( using: . utf8) else {
318
313
XCTFail ( " Unable to convert string to data " )
319
314
return
320
315
}
321
316
let result = try JSONSerialization . jsonObject ( with: data, options: [ ] ) as? [ Any ]
317
+ // result?[0] as? String returns an Optional<String> and RHS is promoted
318
+ // to Optional<String>
322
319
XCTAssertEqual ( result ? [ 0 ] as? String , " \u{1D11E} " )
323
320
} catch {
324
321
XCTFail ( " Unexpected error: \( error) " )
325
322
}
326
- */
327
323
}
328
324
329
325
func test_deserialize_allowFragments( ) {
0 commit comments