Skip to content

Commit

Permalink
Activate and Fix FindReplaceLogicTest
Browse files Browse the repository at this point in the history
The FindReplaceLogic was not included in the TestSuite and thus not
executed by CI. Additionally, I fixed a bug where the tests would
not run correctly on linux and mac because windows-style
line-breaks were assumed in the Strings.
  • Loading branch information
Wittmaxi authored and merks committed Feb 26, 2024
1 parent ea87817 commit cb121fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ public void testPerformReplaceAllForwardRegEx() {

findReplaceLogic.performReplaceAll("[", "", parentShell.getDisplay());
assertThat(textViewer.getDocument().get(), equalTo("almost@an_email"));
expectStatusIsMessageWithString(findReplaceLogic, "Unclosed character class near index 0\r\n"
+ "[\r\n"
expectStatusIsMessageWithString(findReplaceLogic, "Unclosed character class near index 0" + System.lineSeparator()
+ "[" + System.lineSeparator()
+ "^");

}
Expand All @@ -176,8 +176,8 @@ public void testPerformReplaceAllForward() {

findReplaceLogic.performReplaceAll("[", "", parentShell.getDisplay());
assertThat(textViewer.getDocument().get(), equalTo("almost@an_email"));
expectStatusIsMessageWithString(findReplaceLogic, "Unclosed character class near index 0\r\n"
+ "[\r\n"
expectStatusIsMessageWithString(findReplaceLogic, "Unclosed character class near index 0" + System.lineSeparator()
+ "[" + System.lineSeparator()
+ "^");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

import org.eclipse.ui.internal.findandreplace.FindReplaceLogicTest;

import org.eclipse.ui.workbench.texteditor.tests.minimap.MinimapPageTest;
import org.eclipse.ui.workbench.texteditor.tests.minimap.MinimapWidgetTest;
import org.eclipse.ui.workbench.texteditor.tests.revisions.ChangeRegionTest;
Expand Down Expand Up @@ -44,7 +46,8 @@
MinimapPageTest.class,
MinimapWidgetTest.class,
TextEditorPluginTest.class,
TextViewerDeleteLineTargetTest.class
TextViewerDeleteLineTargetTest.class,
FindReplaceLogicTest.class,
})
public class WorkbenchTextEditorTestSuite {
// see @SuiteClasses
Expand Down

0 comments on commit cb121fe

Please sign in to comment.