mirror of https://github.com/tc39/test262.git
Add tests for proposal-well-formed-stringify
* unpaired surrogate escape sequences
This commit is contained in:
parent
783fc5d8bb
commit
ce967f7a86
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2018 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-quotejsonstring
|
||||
description: >
|
||||
JSON.stringify strings containing surrogate code units
|
||||
---*/
|
||||
|
||||
assert.sameValue(JSON.stringify("\uD834"), '"\\ud834"',
|
||||
'JSON.stringify("\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uDF06"), '"\\udf06"',
|
||||
'JSON.stringify("\\uDF06")');
|
||||
|
||||
assert.sameValue(JSON.stringify("\uD834\uDF06"), '"𝌆"',
|
||||
'JSON.stringify("\\uD834\\uDF06")');
|
||||
assert.sameValue(JSON.stringify("\uD834\uD834\uDF06\uD834"), '"\\ud834𝌆\\ud834"',
|
||||
'JSON.stringify("\\uD834\\uD834\\uDF06\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uD834\uD834\uDF06\uDF06"), '"\\ud834𝌆\\udf06"',
|
||||
'JSON.stringify("\\uD834\\uD834\\uDF06\\uDF06")');
|
||||
assert.sameValue(JSON.stringify("\uDF06\uD834\uDF06\uD834"), '"\\udf06𝌆\\ud834"',
|
||||
'JSON.stringify("\\uDF06\\uD834\\uDF06\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uDF06\uD834\uDF06\uDF06"), '"\\udf06𝌆\\udf06"',
|
||||
'JSON.stringify("\\uDF06\\uD834\\uDF06\\uDF06")');
|
||||
|
||||
assert.sameValue(JSON.stringify("\uDF06\uD834"), '"\\udf06\\ud834"',
|
||||
'JSON.stringify("\\uDF06\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uD834\uDF06\uD834\uD834"), '"𝌆\\ud834\\ud834"',
|
||||
'JSON.stringify("\\uD834\\uDF06\\uD834\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uD834\uDF06\uD834\uDF06"), '"𝌆𝌆"',
|
||||
'JSON.stringify("\\uD834\\uDF06\\uD834\\uDF06")');
|
||||
assert.sameValue(JSON.stringify("\uDF06\uDF06\uD834\uD834"), '"\\udf06\\udf06\\ud834\\ud834"',
|
||||
'JSON.stringify("\\uDF06\\uDF06\\uD834\\uD834")');
|
||||
assert.sameValue(JSON.stringify("\uDF06\uDF06\uD834\uDF06"), '"\\udf06\\udf06𝌆"',
|
||||
'JSON.stringify("\\uDF06\\uDF06\\uD834\\uDF06")');
|
Loading…
Reference in New Issue