Ejemplo n.º 1
0
  @Test
  public void testIdentifierTick() throws Exception {
    final Start root = parseInput("machine Mac variables x' y end", false);
    final AMachineParseUnit parseUnit = (AMachineParseUnit) root.getPParseUnit();

    final LinkedList<PVariable> variables = parseUnit.getVariables();
    assertEquals(2, variables.size());

    assertEquals("x'", ((AVariable) variables.get(0)).getName().getText());
    assertEquals("y", ((AVariable) variables.get(1)).getName().getText());
  }
Ejemplo n.º 2
0
  @Test
  public void testWitnessTick() throws Exception {
    final Start root =
        parseInput("machine WitnessTick\nevents\nevent Eve\nwith\n@x' x' :: NAT\nend\nend", false);
    final AMachineParseUnit parseUnit = (AMachineParseUnit) root.getPParseUnit();

    final LinkedList<PEvent> events = parseUnit.getEvents();
    assertEquals(1, events.size());

    final AEvent event = (AEvent) events.get(0);
    final LinkedList<PWitness> witnesses = event.getWitnesses();
    assertEquals(1, witnesses.size());

    assertEquals("x'", ((AWitness) witnesses.get(0)).getName().getText());
  }