[logback-dev] svn commit: r1839 - logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser
noreply.ceki at qos.ch
noreply.ceki at qos.ch
Wed Oct 15 21:27:28 CEST 2008
Author: ceki
Date: Wed Oct 15 21:27:28 2008
New Revision: 1839
Modified:
logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
Log:
new test case on parentheses closing in patterns
Modified: logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java
==============================================================================
--- logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java (original)
+++ logback/trunk/logback-core/src/test/java/ch/qos/logback/core/pattern/parser/SamplePatternLayoutTest.java Wed Oct 15 21:27:28 2008
@@ -45,15 +45,28 @@
assertEquals("x123", s);
}
+
+
+ @Test
+ public void testEscapeClosingParentheses() {
+ PatternLayoutBase<Object> plb = getPatternLayoutBase();
+ Context context = new ContextBase();
+ plb.setContext(context);
+ plb.setPattern("x(%OTT\\)y");
+ plb.start();
+ String s = plb.doLayout(new Object());
+ assertEquals("x(123)y", s);
+ }
+
@Test
- public void testParentheses() {
+ public void testEscapeBothParentheses() {
PatternLayoutBase<Object> plb = getPatternLayoutBase();
Context context = new ContextBase();
plb.setContext(context);
- plb.setPattern("x(%OTT\\)");
+ plb.setPattern("x\\(%OTT\\)y");
plb.start();
String s = plb.doLayout(new Object());
- assertEquals("x(123)", s);
+ assertEquals("x(123)y", s);
}
@Test
More information about the logback-dev
mailing list