use of com.goide.runconfig.file.GoRunFileConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method testSameRunApplicationConfigurationOnFile.
public void testSameRunApplicationConfigurationOnFile() {
PsiFile file = myFixture.configureByText("a.go", "package main; <caret>\nfunc main() {}");
PsiElement at = file.findElementAt(myFixture.getCaretOffset());
assertNotNull(at);
ConfigurationContext configurationContext = new ConfigurationContext(at);
GoRunFileConfigurationProducer producer = new GoRunFileConfigurationProducer();
GoRunFileConfiguration runConfiguration = createFileConfiguration(file.getVirtualFile().getPath());
assertTrue(producer.isConfigurationFromContext(runConfiguration, configurationContext));
runConfiguration = createFileConfiguration(file.getVirtualFile().getPath() + "_vl");
assertFalse(producer.isConfigurationFromContext(runConfiguration, configurationContext));
}
use of com.goide.runconfig.file.GoRunFileConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method testSameRunFileConfigurationOnFile.
public void testSameRunFileConfigurationOnFile() {
PsiFile file = myFixture.configureByText("a.go", "package main; <caret>\nfunc main() {}");
PsiElement at = file.findElementAt(myFixture.getCaretOffset());
assertNotNull(at);
ConfigurationContext configurationContext = new ConfigurationContext(at);
GoRunFileConfigurationProducer producer = new GoRunFileConfigurationProducer();
GoRunFileConfiguration runConfiguration = createFileConfiguration(file.getVirtualFile().getPath());
assertTrue(producer.isConfigurationFromContext(runConfiguration, configurationContext));
runConfiguration = createFileConfiguration(file.getVirtualFile().getPath() + "_vl");
assertFalse(producer.isConfigurationFromContext(runConfiguration, configurationContext));
}
use of com.goide.runconfig.file.GoRunFileConfiguration in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoRunConfigurationProducerTest method createFileConfiguration.
private GoRunFileConfiguration createFileConfiguration(String filePath) {
GoRunFileConfigurationType type = GoRunFileConfigurationType.getInstance();
GoRunFileConfiguration result = new GoRunFileConfiguration(myFixture.getProject(), "run file", type);
result.setFilePath(filePath);
return result;
}
Aggregations