mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-28 15:32:40 -04:00
added additional parser test case
This commit is contained in:
parent
32da3e7d9b
commit
9db4942e2e
@ -8,7 +8,7 @@ HEAD, planned as v0.13
|
||||
CAUTION: All default values are lost! If you have built a circuit that contains
|
||||
test cases that depend on a non-null default value, this tests will fail. To
|
||||
resolve this issue, reset the default value.
|
||||
- added an enable input to the T flip-flop
|
||||
- Added an enable input to the T flip-flop
|
||||
CAUTION: By default this input is activated now. In circuits which used the T flip-flop
|
||||
in the past, the new input needs to be disabled.
|
||||
- A warning message shows up if a circuit with unnamed inputs is analysed.
|
||||
|
@ -74,8 +74,8 @@ public class ParserTest extends TestCase {
|
||||
public void testParseLet() throws Exception {
|
||||
Expression exp = createSingle("let u=a+b");
|
||||
assertTrue(exp instanceof NamedExpression);
|
||||
assertEquals("u", ((NamedExpression)exp).getName());
|
||||
assertTrue(((NamedExpression)exp).getExpression() instanceof Operation.Or);
|
||||
assertEquals("u", ((NamedExpression) exp).getName());
|
||||
assertTrue(((NamedExpression) exp).getExpression() instanceof Operation.Or);
|
||||
}
|
||||
|
||||
public void testParseLetError() throws Exception {
|
||||
@ -95,6 +95,20 @@ public class ParserTest extends TestCase {
|
||||
assertEquals(new Variable("c"), expList.get(2));
|
||||
}
|
||||
|
||||
public void testParseList2() throws Exception {
|
||||
ArrayList<Expression> expList = new Parser("let u=a,let v=b,let w=c").parse();
|
||||
assertEquals(3, expList.size());
|
||||
assertTrue(expList.get(0) instanceof NamedExpression);
|
||||
assertEquals(((NamedExpression) expList.get(0)).getName(), "u");
|
||||
assertEquals(((NamedExpression) expList.get(0)).getExpression(), new Variable("a"));
|
||||
assertTrue(expList.get(1) instanceof NamedExpression);
|
||||
assertEquals(((NamedExpression) expList.get(1)).getName(), "v");
|
||||
assertEquals(((NamedExpression) expList.get(1)).getExpression(), new Variable("b"));
|
||||
assertTrue(expList.get(2) instanceof NamedExpression);
|
||||
assertEquals(((NamedExpression) expList.get(2)).getName(), "w");
|
||||
assertEquals(((NamedExpression) expList.get(2)).getExpression(), new Variable("c"));
|
||||
}
|
||||
|
||||
public void testParseRegression() throws Exception {
|
||||
Expression e = createSingle("B*(B+A)*(B+C)*(A+B+C)");
|
||||
Expression simplified = QuineMcCluskey.simplify(e);
|
||||
|
Loading…
x
Reference in New Issue
Block a user