protected void assertEditorContentsSame(ResourceFile file, String expectedText) {

		Map<ResourceFile, GhidraScriptEditorComponentProvider> editorMap = provider.getEditorMap();
		GhidraScriptEditorComponentProvider fileEditor = editorMap.get(file);
		final JTextArea textArea = (JTextArea) findComponentByName(fileEditor.getComponent(),
			GhidraScriptEditorComponentProvider.EDITOR_COMPONENT_NAME);
		assertNotNull(textArea);

		final String[] box = new String[1];
		runSwing(() -> box[0] = textArea.getText());

		assertEquals("The editor's text does not contain the expected text.  File: " + file,
			expectedText, box[0]);
	}
Run the last script by pressing the last script button and return output.

@param taskName name for the task listener
@return script output written to the console
@throws Exception on failure, e.g. timeout
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/script/AbstractGhidraScriptMgrPluginTest.java