1
0
Fork 0

added test

This commit is contained in:
Jan Steemann 2013-08-19 12:36:13 +02:00
parent 869c21f156
commit 6dcdf5582e
1 changed files with 15 additions and 0 deletions

View File

@ -418,6 +418,21 @@ function ahuacatlBindTestSuite () {
assertEqual([ { "the fox" : 1 } ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test bound attribute names
////////////////////////////////////////////////////////////////////////////////
testBindAttributeNames5 : function () {
var actual = getQueryResults("FOR u IN [ { name: { first: 'foo', last: 'bar' } } ] FILTER u.name.@part1 == 'foo' && u.name.@part2 == 'bar' RETURN u", { "part1" : "first", "part2" : "last" });
assertEqual([ { name: { first: "foo", last: "bar" } } ], actual);
actual = getQueryResults("FOR u IN [ { name: { first: 'foo', last: 'bar' } } ] FILTER u.@part1.@first == 'foo' && u.@part1.@last == 'bar' RETURN u", { "part1" : "name", "first" : "first", "last" : "last" });
assertEqual([ { name: { first: "foo", last: "bar" } } ], actual);
actual = getQueryResults("FOR u IN [ { values: [ { age: 28 }, { age: 30 }, { age: 40 } ] } ] RETURN u.values[*].@what", { "what" : "age" });
assertEqual([ [ 28, 30, 40 ] ], actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test bound attribute names
////////////////////////////////////////////////////////////////////////////////