/**
* Test metody createAutomatonFromOneAutomaton.
*/
public final void testCreateAutomatonFromOneAutomaton() {
AutomatonSpecification automaton = new NaiveAutomatonSpecification();
State q0 = automaton.addState();
State q1 = automaton.addState();
State q2 = automaton.addState();
automaton.addTransition(q0, q1, new CharTransitionLabel('a'));
automaton.addTransition(q1, q2, new CharTransitionLabel('b'));
automaton.addLoop(q1, new CharTransitionLabel('a'));
automaton.addLoop(q2, new CharTransitionLabel('b'));
automaton.markAsInitial(q0);
automaton.markAsFinal(q2);
AtLeastOneOperator operator = new AtLeastOneOperator();
NondeterministicAutomatonByThompsonApproach result =
new NondeterministicAutomatonByThompsonApproach(
operator.createAutomatonFromOneAutomaton(automaton));
assertTrue(result.accepts("aaaab"));
assertTrue(result.accepts("abbbbb"));
assertTrue(result.accepts("aaaaaaaaaaaabb"));
assertTrue(result.accepts("abbbaaaab"));
assertTrue(result.accepts("abababb"));
assertFalse(automaton.acceptEmptyWord());
assertFalse(result.accepts("baba"));
assertFalse(result.accepts("baaaaaaaaa"));
assertFalse(result.accepts("cojatestujem"));
assertFalse(result.accepts("bartlomiejburczymucha"));
}