Add trailing escape character test

Update `OriginTrackedPropertiesLoaderTests` to also test that an escape
character can be the last character on a line.
pull/22524/head
Phillip Webb 4 years ago
parent 2eeffe7931
commit fdc6e80163

@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -248,6 +248,12 @@ class OriginTrackedPropertiesLoaderTests {
assertThat(getValue(value)).isEqualTo("trailing ");
}
@Test
void getPropertyWithEscapedTrailingSpace() {
OriginTrackedValue value = this.properties.get("test-with-escaped-trailing-space");
assertThat(getValue(value)).isEqualTo("trailing ");
}
private Object getValue(OriginTrackedValue value) {
return (value != null) ? value.getValue() : null;
}

@ -42,3 +42,4 @@ test-multiline-immediate-bang=\
test-iso8859-1-chars=æ×ÈÅÞßáñÀÿ
test-with-trailing-space= trailing
test-with-escaped-trailing-space= trailing\

Loading…
Cancel
Save