mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
improve escaping tests
This commit is contained in:
parent
1cce7d8a61
commit
6e027ed3b7
@ -30,11 +30,22 @@ public class BindingEscapingTest {
|
|||||||
private final static Logger logger = LoggerFactory.getLogger(BindingEscapingTest.class);
|
private final static Logger logger = LoggerFactory.getLogger(BindingEscapingTest.class);
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testEscapedBindings() {
|
public void testThatEscapesAreNotUnescapedInSingleQuotes() {
|
||||||
DataMapper<String> mapper = VirtData.getMapper("Template('\"-{}-\"Func(234)\\\\\"\\\\)',NumberNameToString())" +
|
DataMapper<String> mapper = VirtData.getMapper(
|
||||||
";'",String.class);
|
"Template('\"-{}-\"Func(234)\\\"\\)',NumberNameToString());"
|
||||||
|
);
|
||||||
String s = mapper.get(234);
|
String s = mapper.get(234);
|
||||||
assertThat(s).isEqualTo("\"-two hundred and thirty four-\"Func(234)\\\"\\)");
|
assertThat(s).isEqualTo("\"-two hundred and thirty four-\"Func(234)\\\"\\)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testThatEscapesAreUnescapedInSingleQuotes() {
|
||||||
|
DataMapper<String> mapper =
|
||||||
|
VirtData.getMapper(
|
||||||
|
"Template(\"\\\"-{}-\\\"Func(234)\\\")\",NumberNameToString());"
|
||||||
|
);
|
||||||
|
String s = mapper.get(234);
|
||||||
|
assertThat(s).isEqualTo("\"-two hundred and thirty four-\"Func(234)\")");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user