1
0
Fork 0

renamed test method

This commit is contained in:
Jan Steemann 2015-12-08 11:49:45 +01:00
parent a5fd77f789
commit a3f42b5072
3 changed files with 6 additions and 10 deletions

View File

@ -266,9 +266,7 @@ std::unordered_map<std::string, Function const> const Executor::FunctionNames{
{ "PASSTHRU", Function("PASSTHRU", "AQL_PASSTHRU", ".", false, false, false, true, true, &Functions::Passthru ) },
{ "NOOPT", Function("NOOPT", "AQL_PASSTHRU", ".", false, false, false, true, true, &Functions::Passthru ) },
{ "V8", Function("V8", "AQL_PASSTHRU", ".", false, false, false, true, true) },
#ifdef TRI_ENABLE_FAILURE_TESTS
{ "TEST_MODIFY", Function("TEST_MODIFY", "AQL_TEST_MODIFY", "s,.", false, false, false, true, false) },
#endif
{ "TEST_INTERNAL", Function("TEST_INTERNAL", "AQL_TEST_INTERNAL", "s,.", false, false, false, true, false) },
{ "SLEEP", Function("SLEEP", "AQL_SLEEP", "n", false, false, true, true, true) },
{ "COLLECTIONS", Function("COLLECTIONS", "AQL_COLLECTIONS", "", false, false, true, false, true) },
{ "NOT_NULL", Function("NOT_NULL", "AQL_NOT_NULL", ".|+", true, true, false, true, true, &Functions::NotNull ) },

View File

@ -4598,7 +4598,7 @@ function AQL_PASSTHRU (value) {
/// this is no actual function the end user should call
////////////////////////////////////////////////////////////////////////////////
function AQL_TEST_MODIFY (test, what) {
function AQL_TEST_INTERNAL (test, what) {
'use strict';
if (test === 'MODIFY_ARRAY') {
what[0] = 1;
@ -9275,7 +9275,7 @@ exports.AQL_MERGE_RECURSIVE = AQL_MERGE_RECURSIVE;
exports.AQL_TRANSLATE = AQL_TRANSLATE;
exports.AQL_MATCHES = AQL_MATCHES;
exports.AQL_PASSTHRU = AQL_PASSTHRU;
exports.AQL_TEST_MODIFY = AQL_TEST_MODIFY;
exports.AQL_TEST_INTERNAL = AQL_TEST_INTERNAL;
exports.AQL_SLEEP = AQL_SLEEP;
exports.AQL_CURRENT_DATABASE = AQL_CURRENT_DATABASE;
exports.AQL_CURRENT_USER = AQL_CURRENT_USER;

View File

@ -127,7 +127,7 @@ function optimizerNativeFunctionsTestSuite () {
testDataModificationObject : function () {
var data = { a: 2, b: 42, c: [ 1 ], d: [ 1 ], e: { a: 1 }, f: [ 0, 1 ] };
var expected = { a: 1, b: 3, c: [ 1, 2 ], d: [ 1, [ 1, 2 ] ], e: { a: 1, f: { a: 1, b: 2 } }, g: "foo" };
var result = AQL_EXECUTE("FOR i IN 1..1 RETURN NOOPT(TEST_MODIFY('MODIFY_OBJECT'," + JSON.stringify(data) + "))", { }, { literalSizeThreshold: 0 });
var result = AQL_EXECUTE("FOR i IN 1..1 RETURN NOOPT(TEST_INTERNAL('MODIFY_OBJECT'," + JSON.stringify(data) + "))", { }, { literalSizeThreshold: 0 });
assertEqual(1, result.json.length);
for (var i = 0; i < 1; ++i) {
@ -142,7 +142,7 @@ function optimizerNativeFunctionsTestSuite () {
testUserFunctionDataModificationArray : function () {
var data = [ 2, 3, [ 1 ], [ 1 ], { a: 1 }, [ 0, 1 ] ];
var expected = [ 1, 42, [ 1, 2 ], [ 1, [ 1, 2 ] ], { a: 9, b: 2 }, [ 0, 1 ], "foo" ];
var result = AQL_EXECUTE("FOR i IN 1..10 RETURN NOOPT(TEST_MODIFY('MODIFY_ARRAY'," + JSON.stringify(data) + "))", { }, { literalSizeThreshold: 0 });
var result = AQL_EXECUTE("FOR i IN 1..10 RETURN NOOPT(TEST_INTERNAL('MODIFY_ARRAY'," + JSON.stringify(data) + "))", { }, { literalSizeThreshold: 0 });
assertEqual(10, result.json.length);
for (var i = 0; i < 10; ++i) {
@ -158,9 +158,7 @@ function optimizerNativeFunctionsTestSuite () {
////////////////////////////////////////////////////////////////////////////////
jsunity.run(optimizerUserFunctionsTestSuite);
if (internal.debugCanUseFailAt()) {
jsunity.run(optimizerNativeFunctionsTestSuite);
}
jsunity.run(optimizerNativeFunctionsTestSuite);
return jsunity.done();