michael@0: // |reftest| fails michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 305064; michael@0: var summary = 'CharacterClassEscape \\s'; michael@0: var actual = ''; michael@0: var expect = ''; michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: test(); michael@0: //----------------------------------------------------------------------------- michael@0: michael@0: function test() michael@0: { michael@0: enterFunc ('test'); michael@0: printBugNumber(BUGNUMBER); michael@0: printStatus (summary); michael@0: michael@0: /** List from ES 3.1 Recommendation for String.trim (bug 305064) **/ michael@0: var whitespace = [ michael@0: {s : '\u0009', t : 'HORIZONTAL TAB'}, michael@0: {s : '\u000B', t : 'VERTICAL TAB'}, michael@0: {s : '\u000C', t : 'FORMFEED'}, michael@0: {s : '\u0020', t : 'SPACE'}, michael@0: {s : '\u00A0', t : 'NO-BREAK SPACE'}, michael@0: {s : '\u1680', t : 'OGHAM SPACE MARK'}, michael@0: {s : '\u180E', t : 'MONGOLIAN VOWEL SEPARATOR'}, michael@0: {s : '\u2000', t : 'EN QUAD'}, michael@0: {s : '\u2001', t : 'EM QUAD'}, michael@0: {s : '\u2002', t : 'EN SPACE'}, michael@0: {s : '\u2003', t : 'EM SPACE'}, michael@0: {s : '\u2004', t : 'THREE-PER-EM SPACE'}, michael@0: {s : '\u2005', t : 'FOUR-PER-EM SPACE'}, michael@0: {s : '\u2006', t : 'SIX-PER-EM SPACE'}, michael@0: {s : '\u2007', t : 'FIGURE SPACE'}, michael@0: {s : '\u2008', t : 'PUNCTUATION SPACE'}, michael@0: {s : '\u2009', t : 'THIN SPACE'}, michael@0: {s : '\u200A', t : 'HAIR SPACE'}, michael@0: {s : '\u202F', t : 'NARROW NO-BREAK SPACE'}, michael@0: {s : '\u205F', t : 'MEDIUM MATHEMATICAL SPACE'}, michael@0: {s : '\u3000', t : 'IDEOGRAPHIC SPACE'}, michael@0: {s : '\u000A', t : 'LINE FEED OR NEW LINE'}, michael@0: {s : '\u000D', t : 'CARRIAGE RETURN'}, michael@0: {s : '\u2028', t : 'LINE SEPARATOR'}, michael@0: {s : '\u2029', t : 'PARAGRAPH SEPARATOR'}, michael@0: {s : '\u200B', t : 'ZERO WIDTH SPACE (category Cf)'} michael@0: ]; michael@0: michael@0: for (var i = 0; i < whitespace.length; ++i) michael@0: { michael@0: var v = whitespace[i]; michael@0: reportCompare(true, !!(/\s/.test(v.s)), 'Is ' + v.t + ' a space'); michael@0: } michael@0: michael@0: exitFunc ('test'); michael@0: }