Index: features/src/test/javascript/features/opensocial-templates/compiler_test.js =================================================================== --- features/src/test/javascript/features/opensocial-templates/compiler_test.js (revision 785321) +++ features/src/test/javascript/features/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]); @@ -34,48 +34,6 @@ } }; -/** - * Unit test for compiler identifier wrapping. - * TODO(kjin): test all of the following: - * "'a'", - * "foo", - * "foo + bar", - * "foo||bar", - * "foo.bar", - * "foo().bar", - * "foo.bar(baz)", - * "foo.bar().baz", - * "foo('a').bar", - * "foo[bar].baz", - * "foo.bar.baz", - * "$my('foo').bar", - * "$cur($context, 'person').ProfileName", - * "foo(bar)[baz]" - */ -function testWrapIdentifiers() { - assertEquals("$_ir($_ir($context, 'foo'), 'bar')", - os.wrapIdentifiersInExpression("foo.bar")); - - assertEquals("$_ir($_ir($context, 'data'), 'array')()", - os.wrapIdentifiersInExpression("data.array()")); - - assertEquals("$_ir($_ir($context, 'data')(), 'array')", - os.wrapIdentifiersInExpression('data().array')); - - // Check that namespaced tags are treated as single identifiers. - 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')", - os.wrapIdentifiersInExpression("foo ? bar : baz")); - - assertEquals("$_ir($_ir($context, 'viewer'), 'foo', $_ea)", - os.wrapIdentifiersInExpression("viewer.foo", "$_ea")); -} - function testTransformVariables() { assertEquals("$this.foo", os.transformVariables_('$cur.foo')); } @@ -196,7 +154,7 @@ var src = '