1 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 7 # 1. Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # 2. Redistributions in binary form must reproduce the above copyright 10 # notice, this list of conditions and the following disclaimer in the 11 # documentation and/or other materials provided with the distribution. 12 # 13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 KDE JS Test 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS (new RegExp()).source is '(?:)' 30 PASS Boolean(new RegExp()) is true 31 PASS isNaN(Number(new RegExp())) is true 32 PASS RegExp(/x/).source is 'x' 33 PASS RegExp('x', 'g').global is true 34 PASS RegExp('x').source is 'x' 35 PASS new RegExp('x').source is 'x' 36 PASS (/a/).global is false 37 PASS typeof (/a/).global is 'boolean' 38 PASS rg.global is true 39 PASS (/a/).ignoreCase is false 40 PASS ri.ignoreCase is true 41 PASS (/a/).multiline is false 42 PASS rm.multiline is true 43 PASS rg.toString() is '/a/g' 44 PASS ri.toString() is '/a/i' 45 PASS rm.toString() is '/a/m' 46 PASS rg.global is true 47 PASS ri.ignoreCase is true 48 PASS rm.multiline is true 49 PASS Boolean(/a/.test) is true 50 PASS /(b)c/.exec('abcd').toString() is "bc,b" 51 PASS /(b)c/.exec('abcd').length is 2 52 PASS /(b)c/.exec('abcd').index is 1 53 PASS /(b)c/.exec('abcd').input is 'abcd' 54 PASS rs.source is 'foo' 55 PASS var r = new RegExp(/x/); r.global=true; r.lastIndex = -1; typeof r.test('a') is 'boolean' 56 PASS 'abcdefghi'.match(/(abc)def(ghi)/).toString() is 'abcdefghi,abc,ghi' 57 PASS /(abc)def(ghi)/.exec('abcdefghi').toString() is 'abcdefghi,abc,ghi' 58 PASS RegExp.$1 is 'abc' 59 PASS RegExp.$2 is 'ghi' 60 PASS RegExp.$3 is '' 61 PASS 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/).toString() is 'abcdefghi,abcdefghi,bcdefgh,cdefg,def,e' 62 PASS RegExp.$1 is 'abcdefghi' 63 PASS RegExp.$2 is 'bcdefgh' 64 PASS RegExp.$3 is 'cdefg' 65 PASS RegExp.$4 is 'def' 66 PASS RegExp.$5 is 'e' 67 PASS RegExp.$6 is '' 68 PASS '(100px 200px 150px 15px)'.match(/\((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*\)/).toString() is '(100px 200px 150px 15px),100,px,200,px,150,px,15,px' 69 PASS RegExp.$1 is '100' 70 PASS RegExp.$3 is '200' 71 PASS RegExp.$5 is '150' 72 PASS RegExp.$7 is '15' 73 PASS ''.match(/((\d+)(px)* (\d+)(px)* (\d+)(px)* (\d+)(px)*)/) is null 74 PASS RegExp.$1 is '100' 75 PASS RegExp.$3 is '200' 76 PASS RegExp.$5 is '150' 77 PASS RegExp.$7 is '15' 78 PASS 'faure (a] kde.org'.match(invalidChars) == null is true 79 PASS 'faure-kde (a] kde.org'.match(invalidChars) == null is false 80 PASS 'test1test2'.replace('test','X') is 'X1test2' 81 PASS 'test1test2'.replace(/\d/,'X') is 'testXtest2' 82 PASS '1test2test3'.replace(/\d/,'') is 'test2test3' 83 PASS 'test1test2'.replace(/test/g,'X') is 'X1X2' 84 PASS '1test2test3'.replace(/\d/g,'') is 'testtest' 85 PASS '1test2test3'.replace(/x/g,'') is '1test2test3' 86 PASS 'test1test2'.replace(/(te)(st)/g,'$2$1') is 'stte1stte2' 87 PASS 'foo+bar'.replace(/\+/g,'%2B') is 'foo%2Bbar' 88 PASS caught is true 89 PASS 'foo'.replace(/z?/g,'x') is 'xfxoxox' 90 PASS 'test test'.replace(/\s*/g,'') is 'testtest' 91 PASS 'abc$%@'.replace(/[^0-9a-z]*/gi,'') is 'abc' 92 PASS 'ab'.replace(/[^\d\.]*/gi,'') is '' 93 PASS '1ab'.replace(/[^\d\.]*/gi,'') is '1' 94 PASS '1test2test3blah'.split(/test/).toString() is '1,2,3blah' 95 PASS reg.exec(str).toString() is '98 ,98 ' 96 PASS reg.lastIndex is 3 97 PASS RegExp.$1 is '98 ' 98 PASS RegExp.$2 is '' 99 PASS reg.exec(str).toString() is '76 ,76 ' 100 PASS reg.lastIndex is 6 101 PASS RegExp.$1 is '76 ' 102 PASS RegExp.$2 is '' 103 PASS reg.exec(str) is null 104 PASS reg.lastIndex is 0 105 PASS myRe=/d(b+)d/g; myArray = myRe.exec('cdbbdbsbz'); myRe.lastIndex is 5 106 PASS reg.ignoreCase == true is true 107 PASS reg.global === false is true 108 PASS reg.multiline === false is true 109 PASS reg.test('UGO') is true 110 PASS reg.x = 1; reg.x is 1 111 PASS var r2 = reg; r2.x = 2; reg.x is 2 112 PASS str.match(re).toString() is 'Chapter 3.4.5.1,Chapter 3.4.5.1,.1' 113 PASS str.match(/d/gi).toString() is 'D,d' 114 PASS /\u0061/.source is '\\u0061' 115 PASS 'abc'.match(/\u0062/).toString() is 'b' 116 FAIL Object.prototype.toString.apply(RegExp.prototype) should be [object RegExp]. Was [object Object]. 117 PASS typeof RegExp.prototype.toString() is 'string' 118 PASS new RegExp().toString() is '/(?:)/' 119 PASS (new RegExp('(?:)')).source is '(?:)' 120 PASS /(?:)/.toString() is '/(?:)/' 121 PASS /(?:)/.source is '(?:)' 122 Done. 123 PASS successfullyParsed is true 124 125 TEST COMPLETE 126 127