mirror of https://gitee.com/bigwinds/arangodb
renamed test method
This commit is contained in:
parent
a5fd77f789
commit
a3f42b5072
|
@ -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 ) },
|
{ "PASSTHRU", Function("PASSTHRU", "AQL_PASSTHRU", ".", false, false, false, true, true, &Functions::Passthru ) },
|
||||||
{ "NOOPT", Function("NOOPT", "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) },
|
{ "V8", Function("V8", "AQL_PASSTHRU", ".", false, false, false, true, true) },
|
||||||
#ifdef TRI_ENABLE_FAILURE_TESTS
|
{ "TEST_INTERNAL", Function("TEST_INTERNAL", "AQL_TEST_INTERNAL", "s,.", false, false, false, true, false) },
|
||||||
{ "TEST_MODIFY", Function("TEST_MODIFY", "AQL_TEST_MODIFY", "s,.", false, false, false, true, false) },
|
|
||||||
#endif
|
|
||||||
{ "SLEEP", Function("SLEEP", "AQL_SLEEP", "n", false, false, true, true, true) },
|
{ "SLEEP", Function("SLEEP", "AQL_SLEEP", "n", false, false, true, true, true) },
|
||||||
{ "COLLECTIONS", Function("COLLECTIONS", "AQL_COLLECTIONS", "", false, false, true, false, 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 ) },
|
{ "NOT_NULL", Function("NOT_NULL", "AQL_NOT_NULL", ".|+", true, true, false, true, true, &Functions::NotNull ) },
|
||||||
|
|
|
@ -4598,7 +4598,7 @@ function AQL_PASSTHRU (value) {
|
||||||
/// this is no actual function the end user should call
|
/// this is no actual function the end user should call
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
function AQL_TEST_MODIFY (test, what) {
|
function AQL_TEST_INTERNAL (test, what) {
|
||||||
'use strict';
|
'use strict';
|
||||||
if (test === 'MODIFY_ARRAY') {
|
if (test === 'MODIFY_ARRAY') {
|
||||||
what[0] = 1;
|
what[0] = 1;
|
||||||
|
@ -9275,7 +9275,7 @@ exports.AQL_MERGE_RECURSIVE = AQL_MERGE_RECURSIVE;
|
||||||
exports.AQL_TRANSLATE = AQL_TRANSLATE;
|
exports.AQL_TRANSLATE = AQL_TRANSLATE;
|
||||||
exports.AQL_MATCHES = AQL_MATCHES;
|
exports.AQL_MATCHES = AQL_MATCHES;
|
||||||
exports.AQL_PASSTHRU = AQL_PASSTHRU;
|
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_SLEEP = AQL_SLEEP;
|
||||||
exports.AQL_CURRENT_DATABASE = AQL_CURRENT_DATABASE;
|
exports.AQL_CURRENT_DATABASE = AQL_CURRENT_DATABASE;
|
||||||
exports.AQL_CURRENT_USER = AQL_CURRENT_USER;
|
exports.AQL_CURRENT_USER = AQL_CURRENT_USER;
|
||||||
|
|
|
@ -127,7 +127,7 @@ function optimizerNativeFunctionsTestSuite () {
|
||||||
testDataModificationObject : function () {
|
testDataModificationObject : function () {
|
||||||
var data = { a: 2, b: 42, c: [ 1 ], d: [ 1 ], e: { a: 1 }, f: [ 0, 1 ] };
|
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 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);
|
assertEqual(1, result.json.length);
|
||||||
for (var i = 0; i < 1; ++i) {
|
for (var i = 0; i < 1; ++i) {
|
||||||
|
@ -142,7 +142,7 @@ function optimizerNativeFunctionsTestSuite () {
|
||||||
testUserFunctionDataModificationArray : function () {
|
testUserFunctionDataModificationArray : function () {
|
||||||
var data = [ 2, 3, [ 1 ], [ 1 ], { a: 1 }, [ 0, 1 ] ];
|
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 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);
|
assertEqual(10, result.json.length);
|
||||||
for (var i = 0; i < 10; ++i) {
|
for (var i = 0; i < 10; ++i) {
|
||||||
|
@ -158,9 +158,7 @@ function optimizerNativeFunctionsTestSuite () {
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
jsunity.run(optimizerUserFunctionsTestSuite);
|
jsunity.run(optimizerUserFunctionsTestSuite);
|
||||||
if (internal.debugCanUseFailAt()) {
|
|
||||||
jsunity.run(optimizerNativeFunctionsTestSuite);
|
jsunity.run(optimizerNativeFunctionsTestSuite);
|
||||||
}
|
|
||||||
|
|
||||||
return jsunity.done();
|
return jsunity.done();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue