Skip to content

Commit 5902394

Browse files
added tests for explicit null
1 parent fc9a55a commit 5902394

5 files changed

Lines changed: 28 additions & 0 deletions

File tree

grails-gradle/plugins/src/test/groovy/org/grails/gradle/plugin/core/GrailsGradlePreserveParametersSpec.groovy

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ class GrailsGradlePreserveParametersSpec extends GradleSpecification {
2424
result.output.contains("HAS_PRESERVE_PARAM_ENABLED=false")
2525
}
2626

27+
def "preserveParameterNames is set to false when configured as explicit null"() {
28+
given:
29+
setupTestResourceProject('preserve-params-null')
30+
31+
when:
32+
def result = executeTask('inspectPreserveParam')
33+
34+
then:
35+
result.output.contains("HAS_PRESERVE_PARAM_ENABLED=false")
36+
}
37+
2738
def "GroovyCompile tasks get parameters = true when preserveParameterNames is enabled"() {
2839
given:
2940
setupTestResourceProject('preserve-params-enabled')
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
plugins {
2+
id 'org.apache.grails.gradle.grails-app'
3+
}
4+
5+
grails {
6+
preserveParameterNames = null
7+
}
8+
9+
tasks.register('inspectPreserveParam') {
10+
doLast {
11+
def compileTasks = tasks.withType(GroovyCompile)
12+
def paramsEnabled = compileTasks.every { it.groovyOptions.parameters }
13+
println "HAS_PRESERVE_PARAM_ENABLED=${paramsEnabled}"
14+
}
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
grailsVersion=__PROJECT_VERSION__

grails-gradle/plugins/src/test/resources/test-projects/preserve-params-null/grails-app/conf/application.yml

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = 'test-preserve-params-null'

0 commit comments

Comments
 (0)