blob: f5d9543de9ed9edb98ffc4319065ad06e69c0180 [file] [log] [blame]
package groovy.tree
/**
* Test case for a bug with nested closures
*/
class NestedClosureBugTest extends GroovyTestCase {
def b
def EXPECTED = 'root[attributes={a=xyz}; value=[child[attributes={}; value=[grandChild[attributes={}; value=[]]]]]]'
void testNestedClosureBug() {
b = NodeBuilder.newInstance()
def root = b.root(['a':'xyz'], {
b.child({
b.grandChild()
})
})
assert EXPECTED == root.toString()
}
}