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
24Test regular expression processing with alternatives that match consuming no characters
25
26On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
27
28
29PASS emptyStr.match(re1) is [""]
30PASS s1.match(re1) is [""]
31PASS s2.match(re1) is ["aaaa"]
32PASS s3.match(re1) is ["aa"]
33PASS emptyStr.match(re2) is [""]
34PASS s1.match(re2) is [""]
35PASS s2.match(re2) is ["aaaa"]
36PASS s3.match(re2) is ["aa"]
37PASS emptyStr.match(re3) is [""]
38PASS s1.match(re3) is [""]
39PASS s2.match(re3) is ["aaaa"]
40PASS s3.match(re3) is ["aa"]
41PASS emptyStr.match(re4) is ["", undefined]
42PASS s1.match(re4) is ["", undefined]
43PASS s2.match(re4) is ["aaaa", "a"]
44PASS s3.match(re4) is ["aa", "a"]
45PASS emptyStr.match(re5) is ["", undefined]
46PASS s1.match(re5) is ["", undefined]
47PASS s2.match(re5) is ["aaaa", "a"]
48PASS s3.match(re5) is ["aa", "a"]
49PASS emptyStr.match(re6) is ["", undefined]
50PASS s1.match(re6) is ["", undefined]
51PASS s2.match(re6) is ["aaaa", "a"]
52PASS s3.match(re6) is ["aa", "a"]
53PASS emptyStr.match(re7) is [""]
54PASS s1.match(re7) is [""]
55PASS s2.match(re7) is ["aaa"]
56PASS s3.match(re7) is ["aa"]
57PASS emptyStr.match(re8) is [""]
58PASS s1.match(re8) is [""]
59PASS s2.match(re8) is ["aaaa"]
60PASS s3.match(re8) is ["aa"]
61PASS emptyStr.match(re9) is [""]
62PASS s1.match(re9) is [""]
63PASS s2.match(re9) is ["aaaa"]
64PASS s3.match(re9) is ["aa"]
65PASS emptyStr.match(re10) is [""]
66PASS s1.match(re10) is [""]
67PASS s2.match(re10) is [""]
68PASS s3.match(re10) is [""]
69PASS emptyStr.match(re11) is [""]
70PASS s1.match(re11) is [""]
71PASS s2.match(re11) is [""]
72PASS s3.match(re11) is [""]
73PASS emptyStr.match(re12) is [""]
74PASS s1.match(re12) is [""]
75PASS s2.match(re12) is [""]
76PASS s3.match(re12) is [""]
77PASS emptyStr.match(re13) is ["", undefined]
78PASS s1.match(re13) is ["", undefined]
79PASS s2.match(re13) is ["", undefined]
80PASS s3.match(re13) is ["", undefined]
81PASS emptyStr.match(re14) is ["", undefined]
82PASS s1.match(re14) is ["", undefined]
83PASS s2.match(re14) is ["", undefined]
84PASS s3.match(re14) is ["", undefined]
85PASS emptyStr.match(re15) is ["", undefined]
86PASS s1.match(re15) is ["", undefined]
87PASS s2.match(re15) is ["", undefined]
88PASS s3.match(re15) is ["", undefined]
89PASS emptyStr.match(re16) is [""]
90PASS s1.match(re16) is [""]
91PASS s2.match(re16) is ["a"]
92PASS s3.match(re16) is ["a"]
93PASS emptyStr.match(re17) is [""]
94PASS s1.match(re17) is [""]
95PASS s2.match(re17) is ["a"]
96PASS s3.match(re17) is ["a"]
97PASS emptyStr.match(re18) is [""]
98PASS s1.match(re18) is [""]
99PASS s2.match(re18) is ["a"]
100PASS s3.match(re18) is ["a"]
101PASS emptyStr.match(re19) is ["", undefined]
102PASS s1.match(re19) is ["", undefined]
103PASS s2.match(re19) is ["a", "a"]
104PASS s3.match(re19) is ["a", "a"]
105PASS emptyStr.match(re20) is ["", undefined]
106PASS s1.match(re20) is ["", undefined]
107PASS s2.match(re20) is ["a", "a"]
108PASS s3.match(re20) is ["a", "a"]
109PASS emptyStr.match(re21) is ["", undefined]
110PASS s1.match(re21) is ["", undefined]
111PASS s2.match(re21) is ["a", "a"]
112PASS s3.match(re21) is ["a", "a"]
113PASS emptyStr.match(re22) is [""]
114PASS s1.match(re22) is [""]
115PASS s2.match(re22) is [""]
116PASS s3.match(re22) is [""]
117PASS emptyStr.match(re23) is [""]
118PASS s1.match(re23) is [""]
119PASS s2.match(re23) is [""]
120PASS s3.match(re23) is [""]
121PASS emptyStr.match(re24) is [""]
122PASS s1.match(re24) is [""]
123PASS s2.match(re24) is [""]
124PASS s3.match(re24) is [""]
125PASS emptyStr.match(re25) is ["", undefined]
126PASS s1.match(re25) is ["", undefined]
127PASS s2.match(re25) is ["", undefined]
128PASS s3.match(re25) is ["", undefined]
129PASS emptyStr.match(re26) is ["", undefined]
130PASS s1.match(re26) is ["", undefined]
131PASS s2.match(re26) is ["", undefined]
132PASS s3.match(re26) is ["", undefined]
133PASS emptyStr.match(re27) is ["", undefined]
134PASS s1.match(re27) is ["", undefined]
135PASS s2.match(re27) is ["", undefined]
136PASS s3.match(re27) is ["", undefined]
137PASS emptyStr.match(re28) is null
138PASS s1.match(re28) is ["x"]
139PASS s2.match(re28) is null
140PASS s3.match(re28) is ["aax"]
141PASS emptyStr.match(re29) is null
142PASS s1.match(re29) is ["x"]
143PASS s2.match(re29) is null
144PASS s3.match(re29) is ["aax"]
145PASS emptyStr.match(re30) is null
146PASS s1.match(re30) is ["x"]
147PASS s2.match(re30) is null
148PASS s3.match(re30) is ["aax"]
149PASS emptyStr.match(re31) is [""]
150PASS s1.match(re31) is [""]
151PASS s3.match(re31) is ["aa"]
152PASS s4.match(re31) is ["abab"]
153PASS emptyStr.match(re32) is [""]
154PASS s1.match(re32) is [""]
155PASS s2.match(re32) is ["aaaa"]
156PASS s4.match(re32) is ["abab"]
157PASS s5.match(re32) is ["ab"]
158PASS s6.match(re32) is [""]
159PASS emptyStr.match(re33) is [""]
160PASS s1.match(re33) is [""]
161PASS s7.match(re33) is ["g0"]
162PASS emptyStr.match(re34) is [""]
163PASS s1.match(re34) is [""]
164PASS s2.match(re34) is [""]
165PASS s3.match(re34) is [""]
166PASS successfullyParsed is true
167
168TEST COMPLETE
169
170