Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(164)

Unified Diff: java/server/src/test/resources/endtoend/opensocial-templates/compiler_test.js

Issue 74074: Replacing expression parsing with a more robust, faster code Base URL: http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Patch Set: Created 14 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « features/src/test/javascript/features/opensocial-templates/index.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: java/server/src/test/resources/endtoend/opensocial-templates/compiler_test.js
===================================================================
--- java/server/src/test/resources/endtoend/opensocial-templates/compiler_test.js (revision 785321)
+++ java/server/src/test/resources/endtoend/opensocial-templates/compiler_test.js (working copy)
@@ -25,8 +25,8 @@
[ "hello ${Cur}", "'hello '+($this)" ],
[ "$ ${Cur}", "'$ '+($this)" ],
[ "$${Cur}", "'$'+($this)" ],
- [ "${Cur} ${Context.Index}", "($this)+' '+($_ir($loop, 'Index'))"],
- [ "a ${Cur} b ${Context.Index} c", "'a '+($this)+' b '+($_ir($loop, 'Index'))+' c'"]
+ [ "${Cur} ${Context.Index}", "($this)+' '+($_ir($loop,'Index'))"],
+ [ "a ${Cur} b ${Context.Index} c", "'a '+($this)+' b '+($_ir($loop,'Index'))+' c'"]
];
for (var i = 0; i < values.length; i++) {
var compiled = os.parseAttribute_(values[i][0]);
@@ -52,23 +52,23 @@
* "foo(bar)[baz]"
*/
function testWrapIdentifiers() {
- assertEquals("$_ir($_ir($context, 'foo'), 'bar')",
+ assertEquals("$_ir($_ir($context,'foo'),'bar')",
os.wrapIdentifiersInExpression("foo.bar"));
- assertEquals("$_ir($_ir($context, 'data'), 'array')()",
+ assertEquals("$_ir($_ir($context,'data'),'array')()",
os.wrapIdentifiersInExpression("data.array()"));
- assertEquals("$_ir($_ir($context, 'data')(), 'array')",
+ assertEquals("$_ir(data(),'array')",
os.wrapIdentifiersInExpression('data().array'));
// Check that namespaced tags are treated as single identifiers.
- assertEquals("$_ir($context, 'os:Item')",
+ assertEquals("$_ir($context,'os:Item')",
os.wrapIdentifiersInExpression("os:Item"));
// Check that a colon surrounded by spaces is not treated as
// part of identifier
- assertEquals("$_ir($context, 'foo') ? $_ir($context, 'bar') : " +
- "$_ir($context, 'baz')",
+ assertEquals("$_ir($context,'foo')?$_ir($context,'bar'):" +
+ "$_ir($context,'baz')",
os.wrapIdentifiersInExpression("foo ? bar : baz"));
}
@@ -194,7 +194,7 @@
var src = '<div repeat="foo">a</div>';
var template = os.compileTemplateString(src);
var select = template.templateRoot_.firstChild.getAttribute("jsselect");
- assertEquals("$_ir($context, 'foo', $_ea)", select);
+ assertEquals("$_ir($context,'foo',$_ea)", select);
}
function testGetFromContext() {
« no previous file with comments | « features/src/test/javascript/features/opensocial-templates/index.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b