From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- js/src/tests/non262/String/string-space-trim.js | 42 +++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 js/src/tests/non262/String/string-space-trim.js (limited to 'js/src/tests/non262/String/string-space-trim.js') diff --git a/js/src/tests/non262/String/string-space-trim.js b/js/src/tests/non262/String/string-space-trim.js new file mode 100644 index 0000000000..0925a9c9f1 --- /dev/null +++ b/js/src/tests/non262/String/string-space-trim.js @@ -0,0 +1,42 @@ +/* Generated by make_unicode.py DO NOT MODIFY */ +/* Unicode version: 15.0.0 */ + +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ +var onlySpace = String.fromCharCode( + 0x0009 /* (CHARACTER TABULATION) */, + 0x000A /* (LINE FEED (LF)) */, + 0x000B /* (LINE TABULATION) */, + 0x000C /* (FORM FEED (FF)) */, + 0x000D /* (CARRIAGE RETURN (CR)) */, + 0x0020 /* SPACE */, + 0x00A0 /* NO-BREAK SPACE (NON-BREAKING SPACE) */, + 0x1680 /* OGHAM SPACE MARK */, + 0x2000 /* EN QUAD */, + 0x2001 /* EM QUAD */, + 0x2002 /* EN SPACE */, + 0x2003 /* EM SPACE */, + 0x2004 /* THREE-PER-EM SPACE */, + 0x2005 /* FOUR-PER-EM SPACE */, + 0x2006 /* SIX-PER-EM SPACE */, + 0x2007 /* FIGURE SPACE */, + 0x2008 /* PUNCTUATION SPACE */, + 0x2009 /* THIN SPACE */, + 0x200A /* HAIR SPACE */, + 0x2028 /* LINE SEPARATOR */, + 0x2029 /* PARAGRAPH SEPARATOR */, + 0x202F /* NARROW NO-BREAK SPACE */, + 0x205F /* MEDIUM MATHEMATICAL SPACE */, + 0x3000 /* IDEOGRAPHIC SPACE */, + 0xFEFF /* ZERO WIDTH NO-BREAK SPACE (BYTE ORDER MARK) */ +); + +assertEq(onlySpace.trim(), ""); +assertEq((onlySpace + 'aaaa').trim(), 'aaaa'); +assertEq(('aaaa' + onlySpace).trim(), 'aaaa'); +assertEq((onlySpace + 'aaaa' + onlySpace).trim(), 'aaaa'); + +if (typeof reportCompare === "function") + reportCompare(true, true); -- cgit v1.2.3