Close resource
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1573188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ea3865e0c
commit
ddc06197e4
|
@ -557,12 +557,14 @@ public class StringEscapeUtilsTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testLang708() throws IOException {
|
public void testLang708() throws IOException {
|
||||||
final String input = IOUtils.toString(new FileInputStream("src/test/resources/lang-708-input.txt"), "UTF-8");
|
final FileInputStream fis = new FileInputStream("src/test/resources/lang-708-input.txt");
|
||||||
|
final String input = IOUtils.toString(fis, "UTF-8");
|
||||||
final String escaped = StringEscapeUtils.escapeEcmaScript(input);
|
final String escaped = StringEscapeUtils.escapeEcmaScript(input);
|
||||||
// just the end:
|
// just the end:
|
||||||
assertTrue(escaped, escaped.endsWith("}]"));
|
assertTrue(escaped, escaped.endsWith("}]"));
|
||||||
// a little more:
|
// a little more:
|
||||||
assertTrue(escaped, escaped.endsWith("\"valueCode\\\":\\\"\\\"}]"));
|
assertTrue(escaped, escaped.endsWith("\"valueCode\\\":\\\"\\\"}]"));
|
||||||
|
fis.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue