Skip to content

Commit

Permalink
added a splitter port test case
Browse files Browse the repository at this point in the history
  • Loading branch information
hneemann committed Jun 5, 2017
1 parent 4cb933e commit cc6f0da
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/test/java/de/neemann/digital/core/wiring/PortsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ public void testPortsRange() throws Exception {
assertEquals(4, outs.get(1).getBits());
}

public void testPortsRangeOneBit() throws Exception {
Splitter.Ports p = new Splitter.Ports("4-4,3-3,2-2,1-1");
ObservableValues outs = p.getOutputs(false);
assertEquals(4, outs.size());
assertEquals(1, outs.get(0).getBits());
assertEquals(1, outs.get(1).getBits());
assertEquals(1, outs.get(2).getBits());
assertEquals(1, outs.get(3).getBits());
}

public void testInputConsistency() throws Exception {
Splitter.Ports p = new Splitter.Ports("4-7,0-2");
try {
Expand Down

0 comments on commit cc6f0da

Please sign in to comment.