upayavira 2004/04/03 22:38:16
Modified: src/java/org/apache/cocoon/components/treeprocessor/variables
PreparedVariableResolver.java
src/test/org/apache/cocoon/components/treeprocessor/variables
PreparedVariableResolverTestCase.java
Log:
Another test case, and another fix.
Revision Changes Path
1.7 +2 -2
cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java
Index: PreparedVariableResolver.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/java/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolver.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PreparedVariableResolver.java 3 Apr 2004 20:57:08 -0000 1.6
+++ PreparedVariableResolver.java 4 Apr 2004 06:38:16 -0000 1.7
@@ -144,7 +144,7 @@
continue;
}
}
- if (i != pos) {
+ if (i != pos || tokens.size()==0) {
// this colon isn't part of a module reference
continue;
}
1.3 +15 -1
cocoon-2.1/src/test/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolverTestCase.java
Index: PreparedVariableResolverTestCase.java
===================================================================
RCS file:
/home/cvs/cocoon-2.1/src/test/org/apache/cocoon/components/treeprocessor/variables/PreparedVariableResolverTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PreparedVariableResolverTestCase.java 3 Apr 2004 20:41:26 -0000
1.2
+++ PreparedVariableResolverTestCase.java 4 Apr 2004 06:38:16 -0000
1.3
@@ -173,6 +173,20 @@
assertEquals("http://cocoon.apache.org", resolver.resolve(context,
getObjectModel()));
}
+ public void testColonBeginningTextContent() throws PatternException {
+ String expr = ":colon-starts-this";
+
+ InvokeContext context = new InvokeContext(true);
+ context.enableLogging(new LogKitLogger(getLogger()));
+
+ Map sitemapElements;
+ sitemapElements = new HashMap();
+ context.pushMap("label", sitemapElements);
+
+ PreparedVariableResolver resolver = new
PreparedVariableResolver(expr, manager);
+ assertEquals(":colon-starts-this", resolver.resolve(context,
getObjectModel()));
+ }
+
public void testEscapedBraces() throws PatternException {
String expr = "This is a \\{brace\\}";