Skip to content

Commit fdc6e80

Browse files
committed
Add trailing escape character test
Update `OriginTrackedPropertiesLoaderTests` to also test that an escape character can be the last character on a line.
1 parent 2eeffe7 commit fdc6e80

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/env/OriginTrackedPropertiesLoaderTests.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -248,6 +248,12 @@ void getPropertyWithTrailingSpace() {
248248
assertThat(getValue(value)).isEqualTo("trailing ");
249249
}
250250

251+
@Test
252+
void getPropertyWithEscapedTrailingSpace() {
253+
OriginTrackedValue value = this.properties.get("test-with-escaped-trailing-space");
254+
assertThat(getValue(value)).isEqualTo("trailing ");
255+
}
256+
251257
private Object getValue(OriginTrackedValue value) {
252258
return (value != null) ? value.getValue() : null;
253259
}

spring-boot-project/spring-boot/src/test/resources/org/springframework/boot/env/test-properties.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ test-multiline-immediate-bang=\
4242
test-iso8859-1-chars=æ×ÈÅÞßáñÀÿ
4343

4444
test-with-trailing-space= trailing
45+
test-with-escaped-trailing-space= trailing\

0 commit comments

Comments
 (0)