@Test
public void testFactor() throws ParserException {

    ExtendedParser parser = new ExtendedParser("-5");
    assertEquals(-5f, parser.readFactor(), 0.0001);
    
    parser = new ExtendedParser("--3");
    assertEquals(3f, parser.readFactor(), 0.0001);
    
    parser = new ExtendedParser("10");
    assertEquals(10f, parser.readFactor(), 0.0001);
    
    parser = new ExtendedParser("varname");
    parser.variables.put("varname", 42f);
    assertEquals(42f, parser.readFactor(), 0.0001);
    parser = new ExtendedParser("-varname");
    parser.variables.put("varname", 42f);
    assertEquals(-42f, parser.readFactor(), 0.0001);
}