alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Groovy example source code file (Unicode2.groovy)

This example Groovy source code file (Unicode2.groovy) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Groovy tags/keywords

groovytestcase, groovytestcase, unicode2, unicode2

The Groovy Unicode2.groovy source code

package gls.ch03.s01;
/**
 * Except for comments, identifiers and the contents of ... string 
 * literals, all input elements are formed from ASCII characters.
 *
 * TODO: Find a better way to test these things
 * Note that this is a little hard to test since the input file is ASCII.
 *
 * @author Jeremy Rayner
 */

class Unicode2 extends GroovyTestCase {

//todo - this doesn't seem to work in raw Java5.0 either
//    public void testUTF16SupplementaryCharacters() {
//        assert 1 == "\uD840\uDC00".length()
//    }

    public void testIdentifiers() {
        def foo\u0044 = 12
        assert 20 == foo\u0044 + 8
    }
}

Other Groovy examples (source code examples)

Here is a short list of links related to this Groovy Unicode2.groovy source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 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.