| 1 |
// Copyright 2009 the Sputnik authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
info: | |
| 6 |
The production CharacterClassEscape :: s evaluates by returning the set of characters |
| 7 |
containing the characters that are on the right-hand side of the WhiteSpace (7.2) or LineTerminator (7.3) productions |
| 8 |
es5id: 15.10.2.12_A1_T5 |
| 9 |
description: > |
| 10 |
Tested string is |
| 11 |
"0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()-+={[}]|\\:;'<,>./?" |
| 12 |
+ '"' |
| 13 |
---*/ |
| 14 |
|
| 15 |
//CHECK#1 |
| 16 |
var non_s = "0123456789_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~`!@#$%^&*()-+={[}]|\\:;'<,>./?" + '"'; |
| 17 |
if (/\s/.exec(non_s) !== null) { |
| 18 |
$ERROR('#1: non-s'); |
| 19 |
} |
| 20 |
|
| 21 |
//CHECK#2 |
| 22 |
var non_S = '\f\n\r\t\v '; |
| 23 |
var regexp_s = /\s/g; |
| 24 |
var k = 0; |
| 25 |
while (regexp_s.exec(non_S) !== null) { |
| 26 |
k++; |
| 27 |
} |
| 28 |
|
| 29 |
if (non_S.length !== k) { |
| 30 |
$ERROR('#2: non-S'); |
| 31 |
} |