@Test public void regex_5() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a1"), new ActionMatchVar()); mapAction.put(Var.alloc("a2"), new ActionMatchString()); noMatch("regex(?x , 'smith', 'i')", "regex(?a1, ?a2)", mapAction); }
@Test public void match_3() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a"), new ActionMatchNoBind()); MapResult mapResult = new MapResult(); match("?x", "?a", mapAction, mapResult); }
@Test public void regex_8() { MapAction mapAction = new MapAction(); // mapAction.put(Var.alloc("a1"), new ActionMatch mapAction.put(Var.alloc("a2"), new ActionMatchString()); mapAction.put(Var.alloc("a3"), new ActionMatchExact("'i'")); noMatch("regex(?x , 'smith', 'i')", "regex(str(?a1), ?a2, ?a3)", mapAction); }
@Test public void match_2() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a"), new ActionMatchVar()); MapResult mapResult = new MapResult(); mapResult.put(Var.alloc("a"), ExprUtils.parse("?x")); match("?x", "?a", mapAction, mapResult); }
@Test public void function_2() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a1"), new ActionMatchVar()); MapResult mapResult = new MapResult(); mapResult.put(Var.alloc("a1"), "?x"); noMatch("fn:not(?x)", "fn:notNot(?a1)", mapAction); }
// ---- Regex tests @Test public void regex_1() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a1"), new ActionMatchVar()); mapAction.put(Var.alloc("a2"), new ActionMatchString()); MapResult mapResult = new MapResult(); mapResult.put(Var.alloc("a1"), "?x"); mapResult.put(Var.alloc("a2"), "'smith'"); match("regex(?x , 'smith')", "regex(?a1 , ?a2)", mapAction, mapResult); }
@Test public void cond_2() { MapAction mapAction = new MapAction(); mapAction.put(Var.alloc("a1"), new ActionMatchVar()); mapAction.put(Var.alloc("a2"), new ActionMatchBind()); MapResult mapResult = new MapResult(); mapResult.put(Var.alloc("a1"), "?x"); mapResult.put(Var.alloc("a2"), "3"); noMatch("?x < 3", "?a1 > ?a2", mapAction); }
@Test public void regex_7() { MapAction mapAction = new MapAction(); // mapAction.put(Var.alloc("a1"), new ActionMatch mapAction.put(Var.alloc("a2"), new ActionMatchString()); mapAction.put(Var.alloc("a3"), new ActionMatchExact("'i'")); MapResult mapResult = new MapResult(); mapResult.put(Var.alloc("a1"), "?x"); mapResult.put(Var.alloc("a2"), "'smith'"); mapResult.put(Var.alloc("a3"), "'i'"); match("regex(str(?x) , 'smith', 'i')", "regex(str(?a1), ?a2, ?a3)", mapAction, mapResult); }