Skip to content

Commit

Permalink
Merge branch 'main' into resolve-drasi-core-security
Browse files Browse the repository at this point in the history
  • Loading branch information
ruokun-niu authored Sep 3, 2024
2 parents 7aed1fa + 29b2349 commit b83f502
Show file tree
Hide file tree
Showing 65 changed files with 7,678 additions and 3,838 deletions.
682 changes: 451 additions & 231 deletions core/src/evaluation/expressions/mod.rs

Large diffs are not rendered by default.

39 changes: 17 additions & 22 deletions core/src/evaluation/expressions/tests/list_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use crate::evaluation::variable_value::float::Float;
use crate::evaluation::variable_value::integer::Integer;
use crate::evaluation::variable_value::VariableValue;
use crate::evaluation::{
EvaluationError, ExpressionEvaluationContext, ExpressionEvaluator, InstantQueryClock,
EvaluationError, ExpressionEvaluationContext, ExpressionEvaluator, FunctionError,
FunctionEvaluationError, InstantQueryClock,
};
use crate::in_memory_index::in_memory_result_index::InMemoryResultIndex;

Expand Down Expand Up @@ -52,14 +53,12 @@ async fn test_list_tail_multiple_arguments() {
.await
.unwrap_err();

let _err = Box::new(EvaluationError::InvalidArgumentCount("tail".to_string()));

assert!(matches!(
result,
EvaluationError::FunctionError {
EvaluationError::FunctionError(FunctionError {
function_name: _name,
error: _err
}
error: FunctionEvaluationError::InvalidArgumentCount
})
));
}

Expand Down Expand Up @@ -150,14 +149,12 @@ async fn test_list_reverse_multiple_arguments() {
.await
.unwrap_err();

let _err = Box::new(EvaluationError::InvalidArgumentCount("reverse".to_string()));

assert!(matches!(
result,
EvaluationError::FunctionError {
function_name: _name,
error: _err
}
EvaluationError::FunctionError(FunctionError {
function_name: _,
error: FunctionEvaluationError::InvalidArgumentCount
})
));
}

Expand Down Expand Up @@ -239,14 +236,12 @@ async fn test_list_range_invalid_arg_count() {
.await
.unwrap_err();

let _err = Box::new(EvaluationError::InvalidArgumentCount("range".to_string()));

assert!(matches!(
result,
EvaluationError::FunctionError {
function_name: _name,
error: _err
}
EvaluationError::FunctionError(FunctionError {
function_name: _,
error: FunctionEvaluationError::InvalidArgumentCount
})
));

let expr = "range(2)";
Expand All @@ -258,9 +253,9 @@ async fn test_list_range_invalid_arg_count() {

assert!(matches!(
result,
EvaluationError::FunctionError {
function_name: _name,
error: _err
}
EvaluationError::FunctionError(FunctionError {
function_name: _,
error: FunctionEvaluationError::InvalidArgumentCount
})
));
}
Loading

0 comments on commit b83f502

Please sign in to comment.