mirror of
https://github.com/lightbend/config.git
synced 2025-03-23 07:40:25 +08:00
Added checkValid() to all list tests in PropertiesTest
This commit is contained in:
parent
c5a9ad6974
commit
caa12b7e16
@ -107,7 +107,9 @@ class PropertiesTest extends TestUtils {
|
||||
props.setProperty("a.4", "4")
|
||||
|
||||
val conf = ConfigFactory.parseProperties(props, ConfigParseOptions.defaults())
|
||||
val reference = ConfigFactory.parseString("{ a : [0,1,2,3,4] }")
|
||||
assertEquals(Seq(0, 1, 2, 3, 4), conf.getIntList("a").asScala.toSeq)
|
||||
conf.checkValid(reference)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -120,7 +122,9 @@ class PropertiesTest extends TestUtils {
|
||||
props.setProperty("a.4", "2")
|
||||
|
||||
val conf = ConfigFactory.parseProperties(props, ConfigParseOptions.defaults())
|
||||
val reference = ConfigFactory.parseString("{ a : [0,1,2] }")
|
||||
assertEquals(Seq(0, 1, 2), conf.getIntList("a").asScala.toSeq)
|
||||
conf.checkValid(reference)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -137,7 +141,9 @@ class PropertiesTest extends TestUtils {
|
||||
props.setProperty("a.4", "4")
|
||||
|
||||
val conf = ConfigFactory.parseProperties(props, ConfigParseOptions.defaults())
|
||||
val reference = ConfigFactory.parseString("{ a : [0,1,2,3,4] }")
|
||||
assertEquals(Seq(0, 1, 2, 3, 4), conf.getIntList("a").asScala.toSeq)
|
||||
conf.checkValid(reference)
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -173,7 +179,9 @@ class PropertiesTest extends TestUtils {
|
||||
a = [-2, -1] ${a}
|
||||
""")
|
||||
val conf = conf2.withFallback(conf1).resolve()
|
||||
val reference = ConfigFactory.parseString("{ a : [-2,-1,0,1,2,3,4,5,6] }")
|
||||
|
||||
assertEquals(Seq(-2, -1, 0, 1, 2, 3, 4, 5, 6), conf.getIntList("a").asScala.toSeq)
|
||||
conf.checkValid(reference)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user