|
Groovy example source code file (Groovy1462_Bug.groovy)
The Groovy Groovy1462_Bug.groovy source codepackage groovy.bugs /** * Verifies that the Groovy parser can accept quoted methods. */ class Groovy1462_Bug extends GroovyTestCase { void testShort() { def smn = new StringMethodName() assert smn.foo0() == 'foo0' assert smn.'foo0'() == 'foo0' assert smn.foo1() == 'foo1' assert smn.'foo1'() == 'foo1' assert smn.foo2() == 2 assert smn.foo3() == 3 assert smn.foo4(3) == 12 assert smn.foo5 == 'foo5' assert !smn.fooFalse() assert smn.fooDef() == null } } class StringMethodName { def foo0() {'foo0'} // control def 'foo1'() {'foo1'} public Integer 'foo2'() {2} public int 'foo3'() {3} Integer 'foo4'(x) { x * 4} public def 'getFoo5'() {'foo5'} private boolean 'fooFalse'() {false} public def 'fooDef'() {} } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy Groovy1462_Bug.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.