|
Groovy example source code file (BooleanBug.groovy)
The Groovy BooleanBug.groovy source codepackage groovy.bugs /** * @version $Revision: 21290 $ */ class BooleanBug extends GroovyTestCase { void testBug() { def x = new BooleanBean(name:'James', foo:true) def y = new BooleanBean(name:'Bob', foo:false) assert x.foo assert ! y.foo y.foo = true assert y.foo } void testBug2() { BooleanBean bean = new BooleanBean(name:'Gromit', foo:false) def value = isApplicableTo(bean) assert value } public boolean isApplicableTo(BooleanBean field) { return !field.isFoo(); } public testBooleanAsMethodArgumentFromCompare() { assertScript """ def foo(x){x} def i = 0 assert foo(i==0)==true """ } } class BooleanBean { String name boolean foo } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy BooleanBug.groovy source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.