adapt ChooseByNameTest to groovy script class name changes (IDEA-151287)

This commit is contained in:
peter
2016-02-09 17:48:35 +01:00
parent 7713379a59
commit da5aa7d73d
@@ -14,6 +14,7 @@
* limitations under the License.
*/
package com.intellij.navigation
import com.intellij.ide.util.gotoByName.*
import com.intellij.lang.java.JavaLanguage
import com.intellij.openapi.Disposable
@@ -28,6 +29,7 @@ import com.intellij.util.Consumer
import com.intellij.util.concurrency.Semaphore
import org.jetbrains.annotations.NotNull
import org.jetbrains.plugins.groovy.lang.psi.GroovyFile
/**
* @author peter
*/
@@ -299,11 +301,10 @@ class Intf {
public void "test groovy script class with non-identifier name"() {
GroovyFile file1 = myFixture.addFileToProject('foo.groovy', '')
myFixture.addFileToProject('foo-bar.groovy', '')
GroovyFile file2 = myFixture.addFileToProject('foo-bar.groovy', '')
def clazz
edt { clazz = file1.scriptClass }
assert getPopupElements(new GotoSymbolModel2(project), 'foo', false) == [clazz]
def variants = getPopupElements(new GotoSymbolModel2(project), 'foo', false)
edt { assert variants == [file1.scriptClass, file2.scriptClass] }
}
private List<Object> getPopupElements(ChooseByNameModel model, String text, boolean checkboxState = false) {