js/src/tests/ecma_3/Unicode/uc-004.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/ecma_3/Unicode/uc-004.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,29 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +
    1.10 +test();
    1.11 +
    1.12 +function test()
    1.13 +{
    1.14 +  enterFunc ("test");
    1.15 +
    1.16 +  printStatus ("Unicode Characters 1C-1F with regexps test.");
    1.17 +  printBugNumber (23612);
    1.18 +   
    1.19 +  var ary = ["\u001Cfoo", "\u001Dfoo", "\u001Efoo", "\u001Ffoo"];
    1.20 +   
    1.21 +  for (var i in ary)
    1.22 +  {      
    1.23 +    reportCompare (0, ary[Number(i)].search(/^\Sfoo$/),
    1.24 +		   "Unicode characters 1C-1F in regexps, ary[" +
    1.25 +		   i + "] did not match \\S test (it should not.)");
    1.26 +    reportCompare (-1, ary[Number(i)].search(/^\sfoo$/),
    1.27 +		   "Unicode characters 1C-1F in regexps, ary[" +
    1.28 +		   i + "] matched \\s test (it should not.)");
    1.29 +  }
    1.30 +
    1.31 +  exitFunc ("test");
    1.32 +}

mercurial