void () { String origText = "first foo\nfoo bar baz\nbaz bar foo\nlast foo"; init(origText); initFind(); EditorSearchSession session = getEditorSearchComponent(); FindModel model = session.getFindModel(); SearchReplaceComponent component = session.getComponent(); ActionButton actionButton = findActionButton(component, "find.regex"); assertFalse(model.isRegularExpressions()); // default is false assertFalse(actionButton.isSelected()); model.setStringToFind("["); assertEquals(ApplicationBundle.message("editorsearch.matches", 0), component.getStatusText()); model.setRegularExpressions(true); assertTrue(actionButton.isSelected()); assertEquals(FindBundle.message(SearchSession.INCORRECT_REGEXP_MESSAGE_KEY), component.getStatusText()); model.setStringToFind("|"); assertEquals(ApplicationBundle.message("editorsearch.empty.string.matches"), component.getStatusText()); model.setStringToFind("ba.?"); assertEquals(ApplicationBundle.message("editorsearch.current.cursor.position", 1, 4), component.getStatusText()); }