1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2012-06-01 13:21:20 +02:00
commit 15a504d023
3 changed files with 61 additions and 28 deletions

View File

@ -1,6 +1,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>ArangoDB - WebAdmin</title>
<style type="text/css" title="screen">
@import "css/layout.css";

View File

@ -1220,29 +1220,38 @@ var lastFormatQuestion = true;
source: shArray
});
if (data == "help") {
data = require("arangosh").HELP;
if (data == "exit") {
location.reload();
return;
}
if (data == "exit") {
location.reload();
return false;
var command;
if (data == "help") {
command = "require(\"arangosh\").HELP";
}
formatQuestion = JSON.parse($('input:radio[name=formatshellJSONyesno]:checked').val());
if (formatQuestion != lastFormatQuestion) {
if (formatQuestion == true) {
start_pretty_print();
lastFormatQuestion = true;
}
if (formatQuestion == false) {
stop_pretty_print();
lastFormatQuestion = false;
else if (data == "reset") {
command = "$('#avocshWindow').html(\"\");undefined;";
}
else {
formatQuestion = JSON.parse($('input:radio[name=formatshellJSONyesno]:checked').val());
if (formatQuestion != lastFormatQuestion) {
if (formatQuestion == true) {
start_pretty_print();
lastFormatQuestion = true;
}
if (formatQuestion == false) {
stop_pretty_print();
lastFormatQuestion = false;
}
}
command = data;
}
var client = "arangosh> " + escapeHTML(data) + "<br>";
$('#avocshWindow').append('<b class="avocshClient">' + client + '</b>');
evaloutput(data);
evaloutput(command);
$("#avocshWindow").animate({scrollTop:$("#avocshWindow")[0].scrollHeight}, 1);
$("#avocshContent").val('');
return false;

View File

@ -118,7 +118,7 @@ function ahuacatlFunctionsTestSuite () {
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test require function
/// @brief test first require function / expected datatype & arg. mismatch
////////////////////////////////////////////////////////////////////////////////
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({ }, { })"); } ));
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(3, null"); } ));
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)"); } ));
},
////////////////////////////////////////////////////////////////////////////////
/// @brief tear contains true1
////////////////////////////////////////////////////////////////////////////////
testContainsTrue1 : function () {
var expected = [false];
var actual = getQueryResults("RETURN CONTAINS(\"test\", \"test2\")", true);
assertEqual(expected, actual);
},
testContainsTrue2 : function () {
var expected = [true];
var actual = getQueryResults("RETURN CONTAINS(\"test2\", \"test\")", true);
assertEqual(expected, actual);
},
testContainsTrue3 : function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief test contains true2
////////////////////////////////////////////////////////////////////////////////
testContainsTrue2 : function () {
var expected = [true];
var actual = getQueryResults("RETURN CONTAINS(\"xxasdxx\", \"asd\")", true);
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 actual = getQueryResults("RETURN CONTAINS(\"test123\", \"\")", true);
assertEqual(expected, actual);
},
testContainsTrue5 : function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief test contanis false3
////////////////////////////////////////////////////////////////////////////////
testContainsFalse3 : function () {
var expected = [false];
var actual = getQueryResults("RETURN CONTAINS(\"\", \"test123\")", true);
assertEqual(expected, actual);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test first function
////////////////////////////////////////////////////////////////////////////////