# Copyright 2013 the V8 project authors. All rights reserved.
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
This page tests handling of parenthetical assertions.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS regex1.exec('xx') is ['xx','x']
PASS regex2.exec('baaabaac') is ['baaabaac','ba',undefined,'abaac']
PASS regex3.exec('aaab') is ['aab','a','aab']
PASS regex4.exec('aaab') is ['aab','a','aab']
PASS regex5.exec('P11') is ['P11','1','1']
PASS regex6.exec('ababbbcbc') is ['ababb','bb','b']
PASS regex7.exec('xx') is ['xx','x']
PASS regex8.exec('xx') is ['xx','x','x']
PASS regex9.exec('xy') is null
PASS regex10.exec('xy') is null
PASS regex11.exec('xy') is null
PASS regex12.exec('x') is null
PASS regex12.exec('xx') is ['xx','x']
PASS regex12.exec('xxy') is ['xx','x']
PASS regex13.exec('xzzzx') is ['xzzzx','x']
PASS regex13.exec('xzzzxy') is ['xzzzx','x']
PASS regex14.exec('aabc') is ['aabc','a','bc']
PASS regex14.exec('aabcx') is ['aabc','a','bc']
PASS regex15.exec('aabc') is ['aabc','a','bc']
PASS regex15.exec('aabcx') is ['aabc','a','bc']
PASS regex16.exec('ab') is null
PASS regex16.exec('abc') is ['abc','bc']
PASS regex17.exec('ab') is ['a','ab']
PASS regex17.exec('abc') is ['a','ab']
PASS regex18.exec('x') is ['x','']
PASS regex18.exec('xx') is ['x','xx']
PASS regex18.exec('xxx') is ['x','xx']
PASS regex19.exec('x') is ['x','',undefined]
PASS regex19.exec('xx') is ['x','xx','xx']
PASS regex19.exec('xxx') is ['x','xx','xx']
PASS regex20.exec('x') is null
PASS regex20.exec('xx') is ['x','xx']
PASS regex20.exec('xxx') is ['x','xx']
PASS regex21.exec('aab') is ['aab']
PASS regex22.exec('55up') is null
PASS regex23.exec('ax') is null
PASS regex24.exec('x') is null
PASS successfullyParsed is true
TEST COMPLETE