Skip to content

Commit edcba4e

Browse files
authored
Test merged properties without comments (#1868)
1 parent 90b0b3e commit edcba4e

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

src/functionalTest/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformerTest.kt

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -160,16 +160,27 @@ class PropertiesFileTransformerTest : BaseTransformerTest() {
160160
}
161161

162162
@Issue(
163-
"https://github.com/GradleUp/shadow/issues/622",
164163
"https://github.com/GradleUp/shadow/issues/856",
165164
)
166165
@Test
167-
fun mergedPropertiesDoNotContainDateComment() {
166+
fun mergedPropertiesWithoutComments() {
168167
val one = buildJarOne {
169-
insert("META-INF/test.properties", "foo=one")
168+
insert(
169+
"META-INF/test.properties",
170+
"""
171+
# A comment from jar one.
172+
foo=one
173+
""".trimIndent(),
174+
)
170175
}
171176
val two = buildJarTwo {
172-
insert("META-INF/test.properties", "foo=two")
177+
insert(
178+
"META-INF/test.properties",
179+
"""
180+
# A comment from jar two.
181+
foo=two
182+
""".trimIndent(),
183+
)
173184
}
174185
projectScript.appendText(
175186
transform<PropertiesFileTransformer>(
@@ -184,10 +195,11 @@ class PropertiesFileTransformerTest : BaseTransformerTest() {
184195
runWithSuccess(shadowJarPath)
185196

186197
val content = outputShadowedJar.use { it.getContent("META-INF/test.properties") }
187-
assertThat(content.trimIndent()).isEqualTo(
198+
assertThat(content.invariantEolString).isEqualTo(
188199
"""
189-
foo=one,two
190-
""".trimIndent(),
200+
|foo=one,two
201+
|
202+
""".trimMargin(),
191203
)
192204
}
193205

0 commit comments

Comments
 (0)