mirror of
https://github.com/lightbend/config.git
synced 2025-01-15 23:01:05 +08:00
test the current behavior of duplicate keys set to object, then primitive, then object
This commit is contained in:
parent
4676023f1c
commit
e1329e54bf
@ -188,6 +188,23 @@ class ConfParserTest extends TestUtils {
|
||||
assertEquals(100, obj.getInt("a.b.c.z"))
|
||||
}
|
||||
|
||||
@Test
|
||||
def duplicateKeyObjectNullObject() {
|
||||
// null is supposed to "reset" the object at key "a"
|
||||
val obj = parseObject("""{ a : { b : 1 }, a : null, a : { c : 2 } }""")
|
||||
assertEquals(1, obj.size())
|
||||
assertEquals(1, obj.getObject("a").size())
|
||||
assertEquals(2, obj.getInt("a.c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
def duplicateKeyObjectNumberObject() {
|
||||
val obj = parseObject("""{ a : { b : 1 }, a : 42, a : { c : 2 } }""")
|
||||
assertEquals(1, obj.size())
|
||||
assertEquals(1, obj.getObject("a").size())
|
||||
assertEquals(2, obj.getInt("a.c"))
|
||||
}
|
||||
|
||||
@Test
|
||||
def impliedCommaHandling() {
|
||||
val valids = Seq(
|
||||
|
Loading…
Reference in New Issue
Block a user