Add trailing escape character test

Update `OriginTrackedPropertiesLoaderTests` to also test that an escape
character can be the last character on a line.
This commit is contained in:
Phillip Webb 2020-07-13 21:08:49 -07:00
parent 2eeffe7931
commit fdc6e80163
2 changed files with 8 additions and 1 deletions

View File

@ -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;
}

View File

@ -42,3 +42,4 @@ test-multiline-immediate-bang=\
test-iso8859-1-chars=<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
test-with-trailing-space= trailing
test-with-escaped-trailing-space= trailing\