Jeroen Hoffman pushed to branch bugfix/HSTTWO-3805 at cms-community / hippo-site-toolkit
Commits: 9db1ca0d by Jeroen Hoffman at 2017-02-23T13:35:16+01:00 HSTTWO-3805 in test class, make more explicit that backslash is removed, and double quote is escaped - - - - - 1 changed file: - content-beans/src/test/java/org/hippoecm/hst/util/TestSearchInputParsingUtils.java Changes: ===================================== content-beans/src/test/java/org/hippoecm/hst/util/TestSearchInputParsingUtils.java ===================================== --- a/content-beans/src/test/java/org/hippoecm/hst/util/TestSearchInputParsingUtils.java +++ b/content-beans/src/test/java/org/hippoecm/hst/util/TestSearchInputParsingUtils.java @@ -210,9 +210,19 @@ public class TestSearchInputParsingUtils { } @Test - public void testSearchInputParsingUtils_bashslash_escaping() throws Exception { + public void testSearchInputParsingUtils_remove_backslash() throws Exception { assertEquals("The quic k", SearchInputParsingUtils.parse("The quic\\k", true, true)); assertEquals("The quick", SearchInputParsingUtils.parse("The quic\\k", true, false)); + assertEquals("", SearchInputParsingUtils.parse("\\", true, true)); + assertEquals("", SearchInputParsingUtils.parse("\\", true, false)); + } + + @Test + public void testSearchInputParsingUtils_escape_doublequote() throws Exception { + assertEquals("The q\\\"uick", SearchInputParsingUtils.parse("The q\"uick", false, true)); + assertEquals("The q\\\"uick", SearchInputParsingUtils.parse("The q\"uick", false, false)); + assertEquals("\\\"", SearchInputParsingUtils.parse("\"", false, true)); + assertEquals("\\\"", SearchInputParsingUtils.parse("\"", false, false)); } } View it on GitLab: https://code.onehippo.org/cms-community/hippo-site-toolkit/commit/9db1ca0d388d2115614b9b6ed7d70549bb55d2f9
_______________________________________________ Hippocms-svn mailing list Hippocms-svn@lists.onehippo.org https://lists.onehippo.org/mailman/listinfo/hippocms-svn