You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by rp...@apache.org on 2020/04/29 05:11:43 UTC
[groovy] branch master updated: GROOVY-9519: add failing test
This is an automated email from the ASF dual-hosted git repository.
rpopma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new cf60cee GROOVY-9519: add failing test
cf60cee is described below
commit cf60cee2a095f40c594fe3b295660a67a1729bdb
Author: Remko Popma <re...@yahoo.com>
AuthorDate: Wed Apr 29 14:11:33 2020 +0900
GROOVY-9519: add failing test
---
.../src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy b/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
index 1c331c8..901066a 100644
--- a/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
+++ b/subprojects/groovy-cli-picocli/src/test/groovy/groovy/cli/picocli/CliBuilderTest.groovy
@@ -1064,4 +1064,15 @@ Usage: groovy [-hV] [-cp] [-pa] [-pr] [--configscript=PARAM]
assertNull(optionAccessor)
}
+ // GROOVY-9519
+ testIntOptionWithDefaultZeroShouldNotConvertToBooleanFalse() {
+ def cli = new CliBuilder()
+ cli.i(type: Integer, longOpt: 'intTest', required: false, args: 1, defaultValue: '0', 'Testing integer with default value 0')
+
+ def opts = cli.parse([]) // no args, so defaults are applied
+ assert opts
+
+ assert Integer == opts.i.getClass()
+ assert opts.i == 0
+ }
}