mirror of
https://github.com/lightbend/config.git
synced 2025-01-28 21:20:07 +08:00
Add some failing tests for ConfigDocument.removeValue
This commit is contained in:
parent
ed004d47e7
commit
dcab6e7158
@ -226,6 +226,30 @@ class ConfigDocumentTest extends TestUtils {
|
|||||||
assertEquals("""{"a": "b" }""", configDoc.removeValue("c").render())
|
assertEquals("""{"a": "b" }""", configDoc.removeValue("c").render())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
def configDocumentRemoveMultiple {
|
||||||
|
val origText = "a { b: 42 }, a.b = 43, a { b: { c: 44 } }"
|
||||||
|
val configDoc = ConfigDocumentFactory.parseString(origText)
|
||||||
|
val removed = configDoc.removeValue("a.b")
|
||||||
|
assertEquals("a { }, a { b: { } }", removed.render())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
def configDocumentRemoveOverridden {
|
||||||
|
val origText = "a { b: 42 }, a.b = 43, a { b: { c: 44 }, a : 57 }"
|
||||||
|
val configDoc = ConfigDocumentFactory.parseString(origText)
|
||||||
|
val removed = configDoc.removeValue("a.b")
|
||||||
|
assertEquals("a { }, a : 57", removed.render())
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
def configDocumentRemoveNested {
|
||||||
|
val origText = "a { b: 42 }, a.b = 43, a { b: { c: 44 } }"
|
||||||
|
val configDoc = ConfigDocumentFactory.parseString(origText)
|
||||||
|
val removed = configDoc.removeValue("a.b.c")
|
||||||
|
assertEquals("a { b: 42 }, a.b = 43, a { b: { } }", removed.render())
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
def configDocumentArrayFailures {
|
def configDocumentArrayFailures {
|
||||||
// Attempting a replace on a ConfigDocument parsed from an array throws an error
|
// Attempting a replace on a ConfigDocument parsed from an array throws an error
|
||||||
|
Loading…
Reference in New Issue
Block a user