|
Groovy example source code file (PropertyNameBug.groovy)
The Groovy PropertyNameBug.groovy source codepackage groovy.bugs /** * Test to fix the issue GROOVY-843. * * @author Pilho Kim * @version $Revision: 2206 $ */ public class PropertyNameBug extends GroovyTestCase { void testNonJavaIdentifierChacactersWithJavaSyntax() { Map map = new HashMap() map.put("foo.bar", "FooBar") map.put("foo.bar-bar", "FooBar-Bar") map.put("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!", "Any character") println("foo.bar1 = ${map.get("foo.bar1")}") println("foo.bar-bar = ${map.get("foo.bar-bar")}") println("Specical Character Test: ${map.get("foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!")}") } void testNonJavaIdentifierChacactersWithGroovySyntax() { def map = [:] map."foo.bar" = "FooBar" map."foo.bar-bar" = "FooBar-Bar" map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!" = "Any character" println("foo.bar1 = ${map."foo.bar1"}") println("foo.bar-bar = ${map."foo.bar-bar"}") println("Specical Character Test: ${map."foo.=;&|^*-+-/\\'?.*:arbitrary()[]{}%#@!"}") } } Other Groovy examples (source code examples)Here is a short list of links related to this Groovy PropertyNameBug.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.