Skip to content

Commit ce7d47f

Browse files
bug presentation
1 parent 0e73fd7 commit ce7d47f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package com.typesafe.config.impl
2+
3+
import com.typesafe.config.{ ConfigFactory, ConfigParseOptions, ConfigRenderOptions }
4+
import org.junit.Test
5+
6+
// Regression tests for rendering old behaviour compatibility
7+
class ConfigDefaultRenderingTest extends TestUtils {
8+
private val parseOptions = ConfigParseOptions.defaults.setAllowMissing(true)
9+
private val myDefaultRenderOptions = ConfigRenderOptions.defaults
10+
.setJson(false)
11+
.setOriginComments(false)
12+
.setComments(true)
13+
.setFormatted(true)
14+
15+
def formatHocon(
16+
str: String): String =
17+
ConfigFactory
18+
.parseString(str, parseOptions)
19+
.root
20+
.render(
21+
myDefaultRenderOptions)
22+
23+
@Test
24+
def properArrayConcat(): Unit = {
25+
val in =
26+
"""except: ${ex1} ${ex2}
27+
|myEmpty: " "
28+
|""".stripMargin
29+
val result = formatHocon(in)
30+
31+
val expected =
32+
"""except = ${ex1} ${ex2}
33+
|myEmpty = " "
34+
|""".stripMargin
35+
36+
println(expected)
37+
println(result)
38+
checkEqualObjects(expected, result)
39+
}
40+
41+
}

0 commit comments

Comments
 (0)