Package edu.cmu.cs.fusion.constraint.operations

Examples of edu.cmu.cs.fusion.constraint.operations.ConstructorOp.matches()


   
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);

    assertTrue(map == null);
  }
 
  @Test
View Full Code Here


  public void testMatchWrongType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());
   
    ConstructorOp op = new ConstructorOp("Baz", new SpecVar[] {utils.getVar(1)}, new String[] {"Bar"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
  }

  @Test
View Full Code Here

  public void testMatchWrongParamType() {
    NewObjectInstruction instr = getNOI(new StubVariable(), new StubVariable());

    ConstructorOp op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(1)}, new String[] {"Baz"});
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null)
  }
 
  @Test
View Full Code Here

    SpecVar[] vars = new SpecVar[] {utils.getVar(0), utils.getVar(1)};
    String[] vTypes = new String[] {"Bar", "Baz"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> map = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(map == null);
   
 
 
View Full Code Here

    NewObjectInstruction instr = getNOI(target, param);
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, target)));
    assertTrue(list.contains(new Binding(utils.getVar(0), param)));
   
View Full Code Here

    NewObjectInstruction instr = getNOI(target, target);
    SpecVar[] vars = new SpecVar[] {utils.getVar(0)};
    String[] vTypes = new String[] {"Bar"};
    ConstructorOp op = new ConstructorOp("Foo", vars, vTypes);
   
    ConsList<Binding> list = op.matches(new EqualityOnlyTypeHierarchy(), null, instr);
   
    assertTrue(list != null);
    assertTrue(list.contains(new Binding(Constraint.RESULT, target)));
    assertTrue(list.contains(new Binding(utils.getVar(0), target)));
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.