use of suite.lp.sewing.impl.SewingClonerImpl in project suite by stupidsing.
the class ClonerFactoryTest method test.
private void test(String pattern, String match) {
for (ClonerFactory cf : new ClonerFactory[] { new CompileClonerImpl(), new SewingClonerImpl() }) {
Node node = new Generalizer().generalize(Suite.parse(pattern));
Clone_ p = cf.cloner(node);
assertTrue(Binder.bind(p.apply(cf.mapper().env()), Suite.parse(match), new Trail()));
}
}
use of suite.lp.sewing.impl.SewingClonerImpl in project suite by stupidsing.
the class EvaluatorFactoryTest method test.
private void test(String pattern, int result) {
for (EvaluatorFactory ef : new EvaluatorFactory[] { //
new CompileExpressionImpl(new CompileClonerImpl()), new SewingExpressionImpl(new SewingClonerImpl()) }) {
Evaluate_ e = ef.evaluator(Suite.parse(pattern));
assertEquals(result, e.evaluate(Env.empty(0)));
}
}
Aggregations