Test with automaton