Package org.rascalmpl.test.infrastructure

Examples of org.rascalmpl.test.infrastructure.TestFramework


    assertTrue(runTestInSameEvaluator("outermost(rules)(t) == f(b(),b())"));
  }
 
  @Test @Ignore
  public void testStrategySeperately(){
    TestFramework tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("A t = f(g(g(b())),g(g(b())));");
    assertTrue(tf.runTestInSameEvaluator("top_down(rules)(t) == f(g(b()),g(b()))"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("A t = f(g(g(b())),g(g(b())));");
    assertTrue(tf.runTestInSameEvaluator("bottom_up(rules)(t) == f(b(),b())"));

    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("B t2 = g(c());");
    assertTrue(tf.runTestInSameEvaluator("once_top_down(rules2)(t2) == c()"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("B t2 = g(c());");
    assertTrue(tf.runTestInSameEvaluator("once_bottom_up(rules2)(t2) == g(b())"));

    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("list[B] l = [g(c()),c()];");
    assertTrue(tf.runTestInSameEvaluator("makeAll(rules2)(l) == [c(),b()]"));

    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("tuple[A,B] t3 = <a(),c()>;");
    assertTrue(tf.runTestInSameEvaluator("top_down(rules2)(t3) == <a(),b()>"));

    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("rel[A, B] r = {<a(), b()>, <f(b(),b()), c()>};");
    assertTrue(tf.runTestInSameEvaluator("top_down(rules3)(r) == {<a(), c()>, <f(c(),c()), c()>}"));

    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("A t4 = f(g(b()),g(b()));");
    assertTrue(tf.runTestInSameEvaluator("top_down(functionToStrategy(rules4))(t4) == f(g(c()),g(c()))"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("A t = f(g(g(b())),g(g(b())));");
    assertTrue(tf.runTestInSameEvaluator("innermost(rules)(t) == f(b(),b())"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import Strategy;");
    tf.prepareMore("A t = f(g(g(b())),g(g(b())));");
    assertTrue(tf.runTestInSameEvaluator("outermost(rules)(t) == f(b(),b())"));
  }
View Full Code Here


    assertTrue(runTestInSameEvaluator("topological_outermost(rules6)(r2) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>}"));
  }
 
  @Test @Ignore
  public void testTopologicalStrategySeperately(){
    TestFramework tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_once_bottom_up(rules5)(r2) == {<a(),ee()>,<a(),d()>,<d(),ee()>}"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_once_top_down(rules5)(r2) == {<aa(),e()>,<aa(),d()>,<d(),e()>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_top_down(rules5)(r2) == {<aa(), dd()>, <aa(), ee()>, <dd(),ee()>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_bottom_up(rules5)(r2) == {<aa(), dd()>, <aa(), ee()>, <dd(),ee()>}"));
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_innermost(rules6)(r2) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[A, A] r2 = {<a(), d()>, <a(), e()>, <d(), e()>};");
    assertTrue(tf.runTestInSameEvaluator("topological_outermost(rules6)(r2) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>}"));
  }
View Full Code Here

    assertTrue(runTestInSameEvaluator("topological_outermost(rules6)(r3) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>, <h(aa()), {<h(aa()), h(ee())>}>}"));
  }
 
  @Test @Ignore
  public void testNestedTopologicalStrategySeperately(){
    TestFramework tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_once_bottom_up(rules5)(r3) == {<a(),ee()>,<a(),d()>,<d(),ee()>, <a(), {<a(), e()>}>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_once_top_down(rules5)(r3) == {<aa(),e()>,<aa(),d()>,<d(),e()>, <aa(), {<a(), e()>}>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_top_down(rules5)(r3) == {<aa(), dd()>, <aa(), ee()>, <dd(),ee()>, <aa(), {<aa(), ee()>}>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_bottom_up(rules5)(r3) == {<aa(), dd()>, <aa(), ee()>, <dd(),ee()>, <aa(), {<aa(), ee()>}>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_innermost(rules6)(r3) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>, <h(aa()), {<h(aa()), h(ee())>}>}"));
   
    tf = new TestFramework();
    tf.prepare("import StrategyTests;");
    tf.prepareMore("import TopologicalStrategy;");
    tf.prepareMore("rel[value, value] r3 = {<a(), d()>, <a(), e()>, <d(), e()>, <a(), {<a(), e()>}>};");
    assertTrue(tf.runTestInSameEvaluator("topological_outermost(rules6)(r3) == {<h(aa()), h(dd())>, <h(aa()), h(ee())>, <h(dd()),h(ee())>, <h(aa()), {<h(aa()), h(ee())>}>}"));
  }
View Full Code Here

TOP

Related Classes of org.rascalmpl.test.infrastructure.TestFramework

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.