groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Di Tommaso <paolo.ditomm...@gmail.com>
Subject ConfigSlurper issue
Date Fri, 24 Nov 2017 20:16:10 GMT
It was my understanding that a ConfigObject dot notation is equivalent to
curly brackets.

However the following snippets create two different objects


def first = '''
        alpha.container = 'foo'

        profiles {
            beta.container='x/y'
            delta.container='1/2'
            alpha.container='bar'
        }
        '''

def second = '''
        alpha.container = 'foo'

        profiles.beta.container='x/y'
        profiles.delta.container='1/2'
        profiles.alpha.container='bar'
        '''

assert new ConfigSlurper().parse(first) == new
ConfigSlurper().parse(second)     // fail



in particular printing the first ConfigObject it return the following
string:


alpha.container='bar'
profiles {
beta.container='x/y'
delta.container='1/2'
}


that doesn't make much sense. Is this a bug or I'm missing something?



Cheers,
Paolo

Mime
View raw message