Permalink
Browse files

test for len added.

  • Loading branch information...
jairodemorais committed Oct 2, 2012
1 parent 9da5638 commit 1e8429e6ea768b7fb5fa598f25ea3768972671fe
Showing with 22 additions and 0 deletions.
  1. +22 −0 test/jasmine-test/spec/coreTests.js
@@ -1006,12 +1006,34 @@ var coreTests = [
expected: " Dog 1 0 Cat 5 1",
message: "should test the array reference access with idx"
},
+ {
+ name: "using len in array reference Accessing",
+ source: "{#list4} {name} {number[$len]}{/list4}",
+ context: { list4: [ {name:"Dog", number: [1,2,3]}, {name:"Cat", number: [4,5,6]}] },
+ expected: " Dog 3 Cat 6",
+ message: "should test the array reference access with len"
+ },
{
name: "using idx in array reference Accessing",
source: "{#list3}{.[$idx].biz}{/list3}",
context: { "list3": [[ { "biz" : "123" } ], [ { "biz" : "345" }, { "biz" : "456" } ]]},
expected: "123456",
message: "should test the array reference access with idx and current context"
+ },
+ {
+ name: "using len in array reference Accessing",
+ source: "{#list3}{.[$len].idx}{/list3}",
+ context: { "list3": [
+ [{"idx": "0"},
+ {"idx": "1"},
+ {"idx": "2"}],
+ [{"idx": "0"},
+ {"idx": "1"},
+ {"idx": "2"}]
+ ]
+ },
+ expected: "22",
+ message: "should test the array reference access with len and current context"
}
];

0 comments on commit 1e8429e

Please sign in to comment.