Skip to content

Commit

Permalink
Pass conditional expression Onigmo tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Apr 2, 2015
1 parent 11f0f55 commit 8fd423e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/org/joni/test/TestA.java
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,26 @@ public void test() throws InterruptedException {
x2s("(?<=\\Babc)d", "aabcd", 4, 5);
x2s("([^\\s]+),(.*)+", " xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ", 1, 62);
x2s(",(.*)+", " xxxx, xxx xxxxxx xxxxxxxxx xxxxxxx, xxxx xxxxx xxxxx ", 5, 62);

x2s("(?:(a)|(b))(?(1)cd)e", "acde", 0, 4);
ns("(?:(a)|(b))(?(1)cd)e", "ae");
x2s("(?:(a)|(b))(?(2)cd)e", "ae", 0, 2);
ns("(?:(a)|(b))(?(2)cd)e", "acde");
x2s("(?:(a)|(b))(?(1)c|d)", "ac", 0, 2);
x2s("(?:(a)|(b))(?(1)c|d)", "bd", 0, 2);
ns("(?:(a)|(b))(?(1)c|d)", "ad");
ns("(?:(a)|(b))(?(1)c|d)", "bc");
x2s("(?:(a)|(b))(?:(?(1)cd)e|fg)", "acde", 0, 4);
x2s("(?:(a)|(b))(?:(?(1)cd|x)e|fg)", "bxe", 0, 3);
ns("(?:(a)|(b))(?:(?(2)cd|x)e|fg)", "bxe");
x2s("(?:(?<x>a)|(?<y>b))(?:(?(<x>)cd|x)e|fg)", "bxe", 0, 3);
ns("(?:(?<x>a)|(?<y>b))(?:(?(<y>)cd|x)e|fg)", "bxe");
x2s("((?<=a))?(?(1)b|c)", "abc", 1, 2);
x2s("((?<=a))?(?(1)b|c)", "bc", 1, 2);
x2s("((?<x>x)|(?<y>y))(?(<x>)y|x)", "xy", 0, 2);
x2s("((?<x>x)|(?<y>y))(?(<x>)y|x)", "yx", 0, 2);
ns("((?<x>x)|(?<y>y))(?(<x>)y|x)", "xx");
ns("((?<x>x)|(?<y>y))(?(<x>)y|x)", "yy");
}

public static void main(String[] args) throws Throwable{
Expand Down

0 comments on commit 8fd423e

Please sign in to comment.