}
}
private void _testAll() throws Exception
{
IPreferenceStore prefs = PerlEditorPlugin.getDefault().getPreferenceStore();
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET1, true);
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET2, true);
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET3, true);
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET4, true);
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE1, true);
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_QUOTE2, true);
PerlEditor editor = openEditor("EPICTest/empty.pl");
PerlEditor.TestInterface testIface = editor.getTestInterface();
try
{
Keyboard.typeString("}");
assertEquals("}", testIface.getText());
testIface.clear();
Keyboard.typeString("{");
assertEquals("{}", testIface.getText());
Keyboard.typeString("{");
assertEquals("{{}}", testIface.getText());
Keyboard.typeString("}");
Keyboard.typeString("}");
assertEquals("{{}}", testIface.getText());
testIface.clear();
Keyboard.typeString("my @x = (foo");
assertEquals("my @x = (foo)", testIface.getText());
Keyboard.typeString(";");
assertEquals("my @x = (foo;)", testIface.getText());
Keyboard.backspace();
assertEquals("my @x = (foo)", testIface.getText());
Keyboard.typeString(")");
assertEquals("my @x = (foo)", testIface.getText());
Keyboard.typeString(";");
assertEquals("my @x = (foo);", testIface.getText());
testIface.clear();
Keyboard.typeString("print aaa");
assertEquals("print aaa", testIface.getText());
Keyboard.left();
Keyboard.left();
Keyboard.left();
Keyboard.typeString("'");
assertEquals("print ''aaa", testIface.getText());
Keyboard.backspace();
assertEquals("print 'aaa", testIface.getText());
Keyboard.right();
Keyboard.right();
Keyboard.right();
Keyboard.right();
Keyboard.typeString("'");
assertEquals("print 'aaa'", testIface.getText());
Keyboard.left();
Keyboard.typeString("'");
Keyboard.typeString(";");
assertEquals("print 'aaa';", testIface.getText());
testIface.clear();
Keyboard.typeString("# ' ok {");
assertEquals("# ' ok {}", testIface.getText());
testIface.clear();
Keyboard.typeString("=comment\nLet's go");
assertEquals("=comment\nLet's go", testIface.getText());
testIface.clear();
prefs.setValue(PreferenceConstants.AUTO_COMPLETION_BRACKET2, false);
Keyboard.typeString(" ");
Keyboard.left();
Keyboard.typeString("${()");