mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel
This commit is contained in:
commit
15a504d023
|
@ -1,6 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||||
<title>ArangoDB - WebAdmin</title>
|
<title>ArangoDB - WebAdmin</title>
|
||||||
<style type="text/css" title="screen">
|
<style type="text/css" title="screen">
|
||||||
@import "css/layout.css";
|
@import "css/layout.css";
|
||||||
|
|
|
@ -1220,29 +1220,38 @@ var lastFormatQuestion = true;
|
||||||
source: shArray
|
source: shArray
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data == "help") {
|
if (data == "exit") {
|
||||||
data = require("arangosh").HELP;
|
location.reload();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data == "exit") {
|
var command;
|
||||||
location.reload();
|
if (data == "help") {
|
||||||
return false;
|
command = "require(\"arangosh\").HELP";
|
||||||
}
|
}
|
||||||
formatQuestion = JSON.parse($('input:radio[name=formatshellJSONyesno]:checked').val());
|
else if (data == "reset") {
|
||||||
if (formatQuestion != lastFormatQuestion) {
|
command = "$('#avocshWindow').html(\"\");undefined;";
|
||||||
if (formatQuestion == true) {
|
}
|
||||||
start_pretty_print();
|
else {
|
||||||
lastFormatQuestion = true;
|
formatQuestion = JSON.parse($('input:radio[name=formatshellJSONyesno]:checked').val());
|
||||||
}
|
if (formatQuestion != lastFormatQuestion) {
|
||||||
if (formatQuestion == false) {
|
if (formatQuestion == true) {
|
||||||
stop_pretty_print();
|
start_pretty_print();
|
||||||
lastFormatQuestion = false;
|
lastFormatQuestion = true;
|
||||||
|
}
|
||||||
|
if (formatQuestion == false) {
|
||||||
|
stop_pretty_print();
|
||||||
|
lastFormatQuestion = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
command = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
var client = "arangosh> " + escapeHTML(data) + "<br>";
|
var client = "arangosh> " + escapeHTML(data) + "<br>";
|
||||||
|
|
||||||
$('#avocshWindow').append('<b class="avocshClient">' + client + '</b>');
|
$('#avocshWindow').append('<b class="avocshClient">' + client + '</b>');
|
||||||
evaloutput(data);
|
evaloutput(command);
|
||||||
$("#avocshWindow").animate({scrollTop:$("#avocshWindow")[0].scrollHeight}, 1);
|
$("#avocshWindow").animate({scrollTop:$("#avocshWindow")[0].scrollHeight}, 1);
|
||||||
$("#avocshContent").val('');
|
$("#avocshContent").val('');
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -118,7 +118,7 @@ function ahuacatlFunctionsTestSuite () {
|
||||||
},
|
},
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief test require function
|
/// @brief test first require function / expected datatype & arg. mismatch
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testContainsFirst : function () {
|
testContainsFirst : function () {
|
||||||
|
@ -128,37 +128,60 @@ function ahuacatlFunctionsTestSuite () {
|
||||||
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS(4, 4)"); } ));
|
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS(4, 4)"); } ));
|
||||||
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS({ }, { })"); } ));
|
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS({ }, { })"); } ));
|
||||||
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS([ ], [ ])"); } ));
|
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS([ ], [ ])"); } ));
|
||||||
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS( null, \"yes\""); } ));
|
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS(null, \"yes\")"); } ));
|
||||||
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS(3, null"); } ));
|
assertEqual(errors.ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH.code, getErrorCode(function() { AHUACATL_RUN("RETURN CONTAINS(3, null)"); } ));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief tear contains true1
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
testContainsTrue1 : function () {
|
testContainsTrue1 : function () {
|
||||||
var expected = [false];
|
|
||||||
var actual = getQueryResults("RETURN CONTAINS(\"test\", \"test2\")", true);
|
|
||||||
assertEqual(expected, actual);
|
|
||||||
},
|
|
||||||
testContainsTrue2 : function () {
|
|
||||||
var expected = [true];
|
var expected = [true];
|
||||||
var actual = getQueryResults("RETURN CONTAINS(\"test2\", \"test\")", true);
|
var actual = getQueryResults("RETURN CONTAINS(\"test2\", \"test\")", true);
|
||||||
assertEqual(expected, actual);
|
assertEqual(expected, actual);
|
||||||
},
|
},
|
||||||
testContainsTrue3 : function () {
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test contains true2
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testContainsTrue2 : function () {
|
||||||
var expected = [true];
|
var expected = [true];
|
||||||
var actual = getQueryResults("RETURN CONTAINS(\"xxasdxx\", \"asd\")", true);
|
var actual = getQueryResults("RETURN CONTAINS(\"xxasdxx\", \"asd\")", true);
|
||||||
assertEqual(expected, actual);
|
assertEqual(expected, actual);
|
||||||
},
|
},
|
||||||
testContainsTrue4 : function () {
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test contains false1
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testContainsFalse1 : function () {
|
||||||
|
var expected = [false];
|
||||||
|
var actual = getQueryResults("RETURN CONTAINS(\"test\", \"test2\")", true);
|
||||||
|
assertEqual(expected, actual);
|
||||||
|
},
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test contains false2
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testContainsFalse2 : function () {
|
||||||
var expected = [false];
|
var expected = [false];
|
||||||
var actual = getQueryResults("RETURN CONTAINS(\"test123\", \"\")", true);
|
var actual = getQueryResults("RETURN CONTAINS(\"test123\", \"\")", true);
|
||||||
assertEqual(expected, actual);
|
assertEqual(expected, actual);
|
||||||
},
|
},
|
||||||
testContainsTrue5 : function () {
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
/// @brief test contanis false3
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
testContainsFalse3 : function () {
|
||||||
var expected = [false];
|
var expected = [false];
|
||||||
var actual = getQueryResults("RETURN CONTAINS(\"\", \"test123\")", true);
|
var actual = getQueryResults("RETURN CONTAINS(\"\", \"test123\")", true);
|
||||||
assertEqual(expected, actual);
|
assertEqual(expected, actual);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief test first function
|
/// @brief test first function
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue