private void searchSelectionInFunction(String buttonText) throws Exception {
		// make a selection
		final AddressSet set = new AddressSet();
		set.addRange(getAddr(0x01002cf0), getAddr(0x01002cf8));
		tool.firePluginEvent(new ProgramSelectionPluginEvent(tableServicePlugin.getName(),
			new ProgramSelection(set), program));

		waitForSwing();

		assertTrue(
			cbPlugin.goToField(getAddr(0x1002cf5), VariableTypeFieldFactory.FIELD_NAME, 0, 3));
		SearchTextDialog dialog = getDialog();
		JComponent container = dialog.getComponent();
		JTextField tf = findTextField(container);

		selectRadioButton(container, buttonText);
		selectCheckBox(container, "Functions");
		setText(tf, "param");

		searchOnce(tf);
		waitForSearchTasks(dialog);

		cbPlugin.updateNow();

		ProgramLocation loc = cbPlugin.getCurrentLocation();
		assertEquals(getAddr(0x1002cf5), loc.getAddress());
		assertTrue(loc instanceof VariableNameFieldLocation);
		assertEquals("param_1", ((VariableNameFieldLocation) loc).getName());

		//
		// Search three more times, then go backwards
		//
		JButton searchButton = findButtonByText(container, "Next");
		pressSearchButton(dialog, searchButton);

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_2", ((VariableNameFieldLocation) loc).getName());

		pressSearchButton(dialog, searchButton);

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_3", ((VariableNameFieldLocation) loc).getName());

		pressSearchButton(dialog, searchButton);

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_4", ((VariableNameFieldLocation) loc).getName());

		searchButton = findButtonByText(container, "Previous");
		pressSearchButton(dialog, searchButton);

		// Unusual code alert!  Doing a reverse above triggers an odd condition where the next
		// action in the plugin is actually processed twice--yes twice!...so wait again
		dialog.getTaskScheduler().waitForCurrentTask();
		cbPlugin.updateNow();

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_3", ((VariableNameFieldLocation) loc).getName());

		pressSearchButton(dialog, searchButton);

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_2", ((VariableNameFieldLocation) loc).getName());

		pressSearchButton(dialog, searchButton);

		loc = cbPlugin.getCurrentLocation();
		assertEquals("param_1", ((VariableNameFieldLocation) loc).getName());
	}
Tests for the search text plugin.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/searchtext/SearchTextPlugin1Test.java