diff --git a/src/test/resources/equiv01/properties-style.conf b/src/test/resources/equiv01/properties-style.conf new file mode 100644 index 00000000..dfd24e4e --- /dev/null +++ b/src/test/resources/equiv01/properties-style.conf @@ -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 diff --git a/src/test/scala/com/typesafe/config/impl/EquivalentsTest.scala b/src/test/scala/com/typesafe/config/impl/EquivalentsTest.scala index 33f017df..94623f3e 100644 --- a/src/test/scala/com/typesafe/config/impl/EquivalentsTest.scala +++ b/src/test/scala/com/typesafe/config/impl/EquivalentsTest.scala @@ -87,6 +87,6 @@ class EquivalentsTest extends TestUtils { // it breaks every time you add a file, so you have to update it. assertEquals(2, dirCount) // this is the number of files not named original.* - assertEquals(11, fileCount) + assertEquals(12, fileCount) } }