mirror of
https://github.com/lightbend/config.git
synced 2025-01-16 07:10:21 +08:00
add properties-style.conf test
Showing .conf format with a properties-looking style
This commit is contained in:
parent
75a1b12284
commit
466a096398
37
src/test/resources/equiv01/properties-style.conf
Normal file
37
src/test/resources/equiv01/properties-style.conf
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# this file is in a no-braces java properties style,
|
||||||
|
# but it's a .conf file with json-style escaping,
|
||||||
|
# not a Java properties file.
|
||||||
|
# lots of playing with whitespace and commas
|
||||||
|
# in here to test various cases; don't copy
|
||||||
|
# this as exemplary, it has gratuitously
|
||||||
|
# stupid formatting.
|
||||||
|
ints.fortyTwo=42
|
||||||
|
ints.fortyTwoAgain = 42 // whitespace ignored around the =
|
||||||
|
floats.fortyTwoPointOne=42.1
|
||||||
|
floats.fortyTwoPointOneAgain:42.1 // colon is fine too
|
||||||
|
strings.abcd=abcd
|
||||||
|
strings.abcdAgain : "abcd", // colon and quotes and comma!
|
||||||
|
strings.a=a
|
||||||
|
strings.b=b
|
||||||
|
strings.c="c",
|
||||||
|
strings.d:"d"
|
||||||
|
strings.concatenated=null bar 42 baz true 3.14 hi # this gets squished to a string
|
||||||
|
arrays.empty=[]
|
||||||
|
arrays.1 : [ 1 ]
|
||||||
|
# it's allowed to omit commas in arrays if you have newlines
|
||||||
|
arrays.12 = [
|
||||||
|
1
|
||||||
|
2
|
||||||
|
]
|
||||||
|
arrays.123 = [1,
|
||||||
|
2
|
||||||
|
3]
|
||||||
|
arrays.ofString = [ "a", "b", "c" ]
|
||||||
|
booleans.true=true
|
||||||
|
booleans.trueAgain=${booleans.true}
|
||||||
|
booleans.false=false
|
||||||
|
# you could quote keys, though here it's pointless
|
||||||
|
# since the key contains no special characters
|
||||||
|
"booleans"."falseAgain" : ${booleans.false},
|
||||||
|
nulls.null=${nulls.nullAgain}
|
||||||
|
nulls.nullAgain=null
|
@ -87,6 +87,6 @@ class EquivalentsTest extends TestUtils {
|
|||||||
// it breaks every time you add a file, so you have to update it.
|
// it breaks every time you add a file, so you have to update it.
|
||||||
assertEquals(2, dirCount)
|
assertEquals(2, dirCount)
|
||||||
// this is the number of files not named original.*
|
// this is the number of files not named original.*
|
||||||
assertEquals(11, fileCount)
|
assertEquals(12, fileCount)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user