You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2003/05/13 18:50:45 UTC
cvs commit: jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse TestTemplateParser.java
hlship 2003/05/13 09:50:45
Modified: junit/src/org/apache/tapestry/junit/script TestScript.java
junit/src/org/apache/tapestry/junit/parse
TestTemplateParser.java
Added: junit/src/org/apache/tapestry/junit/script
name-append.script
Log:
Fix a bug in the script template parsing code where literal strings starting with a dollar sign were truncated.
Revision Changes Path
1.4 +15 -3 jakarta-tapestry/junit/src/org/apache/tapestry/junit/script/TestScript.java
Index: TestScript.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/script/TestScript.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestScript.java 25 Apr 2003 01:18:32 -0000 1.3
+++ TestScript.java 13 May 2003 16:50:45 -0000 1.4
@@ -232,8 +232,8 @@
execute("unique-let.script", symbols);
assertSymbol(symbols, "alpha", "Alpha");
- assertSymbol(symbols, "beta", "Alpha_0");
- assertSymbol(symbols, "gamma", "Alpha_1");
+ assertSymbol(symbols, "beta", "Alpha$0");
+ assertSymbol(symbols, "gamma", "Alpha$1");
}
/**
@@ -433,6 +433,18 @@
checkException(ex, "key");
}
+ }
+
+ /** @since 3.0 */
+
+ public void testNameAppend() throws Exception
+ {
+ Map symbols = new HashMap();
+
+ symbols.put("name", "fred");
+ execute("name-append.script", symbols);
+
+ assertSymbol(symbols, "output", "fred$suffix");
}
/**
1.1 jakarta-tapestry/junit/src/org/apache/tapestry/junit/script/name-append.script
Index: name-append.script
===================================================================
<?xml version="1.0"?>
<!-- $Id: invalid-key-let.script,v 1.1 2003/03/05 23:19:36 hlship Exp $ -->
<!DOCTYPE script PUBLIC
"-//Howard Lewis Ship//Tapestry Script 1.2//EN"
"http://tapestry.sf.net/dtd/Script_1_2.dtd">
<script>
<input-symbol key="name" class="java.lang.String" required="yes"/>
<let key="output">
<!-- There was a bug where the last letter ('x') was getting clipped. -->
${name}$suffix
</let>
</script>
1.12 +2 -2 jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/TestTemplateParser.java
Index: TestTemplateParser.java
===================================================================
RCS file: /home/cvs/jakarta-tapestry/junit/src/org/apache/tapestry/junit/parse/TestTemplateParser.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- TestTemplateParser.java 21 Apr 2003 13:15:29 -0000 1.11
+++ TestTemplateParser.java 13 May 2003 16:50:45 -0000 1.12
@@ -640,7 +640,7 @@
AttributeType.OGNL_EXPRESSION,
buildMap(new String[] { "value", "components.loop.value.name" }));
- assertOpenToken(tokens[8], "$Insert_0", "Insert", "span", 11);
+ assertOpenToken(tokens[8], "$Insert$0", "Insert", "span", 11);
assertTemplateAttributes(
tokens[8],