jpountz commented on code in PR #14193:
URL: https://github.com/apache/lucene/pull/14193#discussion_r1944819744
##########
lucene/core/src/test/org/apache/lucene/util/automaton/TestAutomaton.java:
##########
@@ -667,11 +667,14 @@ public void testConcatenatePreservesDet() throws
Exception {
}
public void testRemoveDeadStates() throws Exception {
- Automaton a =
- Operations.concatenate(Arrays.asList(Automata.makeString("x"),
Automata.makeString("y")));
- assertEquals(4, a.getNumStates());
+ Automaton a = new Automaton();
+ int s1 = a.createState();
+ a.createState(); // create dead state
+ a.setAccept(s1, true);
+ a.finishState();
+ assertEquals(2, a.getNumStates());
a = Operations.removeDeadStates(a);
- assertEquals(3, a.getNumStates());
+ assertEquals(1, a.getNumStates());
}
Review Comment:
Much better, thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]