File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
config/src/test/scala/com/typesafe/config/impl Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments