mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
gdsl: assertVersion as agreed
This commit is contained in:
@@ -105,8 +105,12 @@ public class GroovyDslExecutor {
|
||||
return StringUtil.compareVersionNumbers(ideaVersion, ver) >= 0
|
||||
}
|
||||
else if (ver instanceof Map) {
|
||||
def we = ver.ide?.intellij
|
||||
return we != null && StringUtil.compareVersionNumbers(ideaVersion, we) >= 0
|
||||
if (ver.dsl) {
|
||||
return StringUtil.compareVersionNumbers('1.0', ver.dsl) >= 0
|
||||
}
|
||||
if (ver.intellij) {
|
||||
return StringUtil.compareVersionNumbers(ideaVersion, ver.intellij) >= 0
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -127,13 +127,13 @@ def doo() { println <warning>foo</warning> }
|
||||
|
||||
public void testSupportsVersion() {
|
||||
checkHighlighting '''
|
||||
if (supportsVersion(ide:[intellij:'9.0'])) {
|
||||
if (supportsVersion(intellij:'9.0')) {
|
||||
contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
} else {
|
||||
contribute(currentType("java.lang.String")) { property name:"bar" }
|
||||
}
|
||||
|
||||
if (!supportsVersion(ide:[groovyEclipse:'9.0'])) {
|
||||
if (!supportsVersion(groovyEclipse:'9.0')) {
|
||||
contribute(currentType("java.lang.String")) { property name:"goo" }
|
||||
}
|
||||
''',
|
||||
@@ -142,7 +142,15 @@ if (!supportsVersion(ide:[groovyEclipse:'9.0'])) {
|
||||
|
||||
public void testAssertVersion() {
|
||||
checkHighlighting '''
|
||||
assertVersion ide:[intellij:'9.0']
|
||||
assertVersion dsl:'1.0'
|
||||
contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
''',
|
||||
'println "".foo'
|
||||
}
|
||||
|
||||
public void testAssertVersionDsl() {
|
||||
checkHighlighting '''
|
||||
assertVersion intellij:'9.0'
|
||||
contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
''',
|
||||
'println "".foo'
|
||||
@@ -150,7 +158,15 @@ contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
|
||||
public void testAssertVersionFail() {
|
||||
checkHighlighting '''
|
||||
assertVersion ide:[intellij:'239.0']
|
||||
assertVersion intellij:'239.0'
|
||||
contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
''',
|
||||
'println "".<warning>foo</warning>'
|
||||
}
|
||||
|
||||
public void testAssertVersionFailDsl() {
|
||||
checkHighlighting '''
|
||||
assertVersion dsl:'239.0'
|
||||
contribute(currentType("java.lang.String")) { property name:"foo" }
|
||||
''',
|
||||
'println "".<warning>foo</warning>'
|
||||
|
||||
Reference in New Issue
Block a user