mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
- IDEA-96179 Replace with a camel case string and Preserve Case on converts the string to lower case
- IDEA-131854 Whole Word search matches partial occurrences
This commit is contained in:
@@ -590,6 +590,37 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
|
||||
FindManagerTestUtils.runFindInCommentsAndLiterals(myFindManager, findModel, text);
|
||||
}
|
||||
|
||||
public void testReplacePreserveCase() {
|
||||
configureByText(FileTypes.PLAIN_TEXT, "Bar bar BAR");
|
||||
FindModel model = new FindModel();
|
||||
model.setStringToFind("bar");
|
||||
model.setStringToReplace("foo");
|
||||
model.setPromptOnReplace(false);
|
||||
model.setPreserveCase(true);
|
||||
|
||||
FindUtil.replace(myProject, myEditor, 0, model);
|
||||
assertEquals("Foo foo FOO", myEditor.getDocument().getText());
|
||||
|
||||
configureByText(FileTypes.PLAIN_TEXT, "Bar bar");
|
||||
|
||||
model.setStringToFind("bar");
|
||||
model.setStringToReplace("fooBar");
|
||||
|
||||
FindUtil.replace(myProject, myEditor, 0, model);
|
||||
assertEquals("FooBar fooBar", myEditor.getDocument().getText());
|
||||
}
|
||||
|
||||
public void testFindWholeWords() {
|
||||
configureByText(FileTypes.PLAIN_TEXT, "-- -- ---");
|
||||
FindModel model = new FindModel();
|
||||
model.setStringToFind("--");
|
||||
model.setWholeWordsOnly(true);
|
||||
|
||||
List<Usage> usages = FindUtil.findAll(myProject, myEditor, model);
|
||||
assertNotNull(usages);
|
||||
assertEquals(2, usages.size());
|
||||
}
|
||||
|
||||
public void testFindInCurrentFileOutsideProject() throws Exception {
|
||||
final TempDirTestFixture tempDirFixture = new TempDirTestFixtureImpl();
|
||||
tempDirFixture.setUp();
|
||||
|
||||
Reference in New Issue
Block a user