private void searchSelection(String buttonText) throws Exception {
		SearchTextDialog dialog = getDialog();
		JComponent container = dialog.getComponent();
		JTextField tf = findTextField(container);
		selectRadioButton(container, buttonText);

		AddressSet set = new AddressSet();
		set.addRange(getAddr(0x01001010), getAddr(0x0100101f));
		set.addRange(getAddr(0x0100107c), getAddr(0x0100107f));

		triggerSelection(set);

		ProgramSelection sel = cbPlugin.getCurrentSelection();
		assertNotNull(sel);
		assertTrue(!sel.isEmpty());
		assertEquals(set, sel);

		JCheckBox cb = (JCheckBox) findButton(container, "Search Selection");
		assertSelected(cb);
		assertEnabled(cb);

		selectCheckBox(container, "Defined Data Mnemonics");

		setText(tf, "addr");

		searchOnce(tf);
		waitForSearchTasks(dialog);

		ProgramLocation loc = cbPlugin.getCurrentLocation();
		assertEquals(getAddr(0x1001010), loc.getAddress());
		assertTrue(loc instanceof MnemonicFieldLocation);
		assertTrue(((MnemonicFieldLocation) loc).getMnemonic().equals("addr"));

		searchOnce(tf);
		waitForSearchTasks(dialog);

		loc = cbPlugin.getCurrentLocation();
		assertEquals(getAddr(0x1001014), loc.getAddress());
		assertTrue(loc instanceof MnemonicFieldLocation);
		assertTrue(((MnemonicFieldLocation) loc).getMnemonic().equals("addr"));

		searchOnce(tf);
		waitForSearchTasks(dialog);

		loc = cbPlugin.getCurrentLocation();
		assertEquals(getAddr(0x1001018), loc.getAddress());
		assertTrue(loc instanceof MnemonicFieldLocation);
		assertTrue(((MnemonicFieldLocation) loc).getMnemonic().equals("addr"));

		searchOnce(tf);
		waitForSearchTasks(dialog);

		loc = cbPlugin.getCurrentLocation();
		assertEquals(getAddr(0x1001018), loc.getAddress());
		assertTrue(loc instanceof MnemonicFieldLocation);
		assertTrue(((MnemonicFieldLocation) loc).getMnemonic().equals("addr"));
		assertEquals("Not found", dialog.getStatusText());
	}
Tests for the search text plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin1Test.java