summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/regexp_parse/Disjunction.js
blob: 55d5d2b7edecd7c3df8315b3de9ba18f08b11b18 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
if (typeof parseRegExp === 'undefined')
    quit();

load(libdir + "regexp_parse.js");

test("a|\u3042", all_flags,
     Disjunction([
         Atom("a"),
         Atom("\u3042")
     ]));

test("a|\u3042|abc", all_flags,
     Disjunction([
         Atom("a"),
         Atom("\u3042"),
         Atom("abc")
     ]));

test("|", all_flags,
     Disjunction([
         Empty(),
         Empty()
     ]));

test("||", all_flags,
     Disjunction([
         Empty(),
         Empty(),
         Empty()
     ]));

test("abc|", all_flags,
     Disjunction([
         Atom("abc"),
         Empty()
     ]));

test("|abc", all_flags,
     Disjunction([
         Empty(),
         Atom("abc")
     ]));