mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 07:25:15 +02:00
Add tests for non-ASCII LineTerminator characters in string literals
This commit is contained in:
parent
48b4aa66af
commit
ba124c31b2
16
test/language/literals/string/line-separator-eval.js
Normal file
16
test/language/literals/string/line-separator-eval.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2018 Richard Gibson. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-literals-string-literals
|
||||||
|
description: >
|
||||||
|
U+2028 LINE SEPARATOR can appear in string literals (eval code).
|
||||||
|
info: |
|
||||||
|
11.8.4 String Literals
|
||||||
|
|
||||||
|
All code points may appear literally in a string literal except for the
|
||||||
|
closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN),
|
||||||
|
and U+000A (LINE FEED).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(eval("'\u2028'"), "\u2028");
|
17
test/language/literals/string/line-separator.js
Normal file
17
test/language/literals/string/line-separator.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2018 Richard Gibson. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-literals-string-literals
|
||||||
|
description: >
|
||||||
|
U+2028 LINE SEPARATOR can appear in string literals.
|
||||||
|
info: |
|
||||||
|
11.8.4 String Literals
|
||||||
|
|
||||||
|
All code points may appear literally in a string literal except for the
|
||||||
|
closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN),
|
||||||
|
and U+000A (LINE FEED).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// U+2028 in strings; UTF8(0x2028) = 0xE2 0x80 0xA8
|
||||||
|
assert.sameValue("
", "\u2028");
|
16
test/language/literals/string/paragraph-separator-eval.js
Normal file
16
test/language/literals/string/paragraph-separator-eval.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Copyright (C) 2018 Richard Gibson. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-literals-string-literals
|
||||||
|
description: >
|
||||||
|
U+2029 PARAGRAPH SEPARATOR can appear in string literals (eval code).
|
||||||
|
info: |
|
||||||
|
11.8.4 String Literals
|
||||||
|
|
||||||
|
All code points may appear literally in a string literal except for the
|
||||||
|
closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN),
|
||||||
|
and U+000A (LINE FEED).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(eval("'\u2029'"), "\u2029");
|
17
test/language/literals/string/paragraph-separator.js
Normal file
17
test/language/literals/string/paragraph-separator.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2018 Richard Gibson. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-literals-string-literals
|
||||||
|
description: >
|
||||||
|
U+2029 PARAGRAPH SEPARATOR can appear in string literals.
|
||||||
|
info: |
|
||||||
|
11.8.4 String Literals
|
||||||
|
|
||||||
|
All code points may appear literally in a string literal except for the
|
||||||
|
closing quote code points, U+005C (REVERSE SOLIDUS), U+000D (CARRIAGE RETURN),
|
||||||
|
and U+000A (LINE FEED).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
// U+2029 in strings; UTF8(0x2029) = 0xE2 0x80 0xA9
|
||||||
|
assert.sameValue("
", "\u2029");
|
Loading…
x
Reference in New Issue
Block a user