fixed queryer relation issues
This commit is contained in:
@ -3479,6 +3479,36 @@ fn test_if_then_else_13_1() {
|
||||
crate::tests::runner::run_test_case(&path, 13, 1).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_database_0_0() {
|
||||
let path = format!("{}/fixtures/database.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 0, 0).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_database_1_0() {
|
||||
let path = format!("{}/fixtures/database.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 1, 0).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_database_2_0() {
|
||||
let path = format!("{}/fixtures/database.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 2, 0).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_database_3_0() {
|
||||
let path = format!("{}/fixtures/database.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 3, 0).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_database_4_0() {
|
||||
let path = format!("{}/fixtures/database.json", env!("CARGO_MANIFEST_DIR"));
|
||||
crate::tests::runner::run_test_case(&path, 4, 0).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_empty_string_0_0() {
|
||||
let path = format!("{}/fixtures/emptyString.json", env!("CARGO_MANIFEST_DIR"));
|
||||
|
||||
@ -78,7 +78,7 @@ pub fn run_test_case(path: &str, suite_idx: usize, case_idx: usize) -> Result<()
|
||||
let mut failures = Vec::<String>::new();
|
||||
|
||||
// For validate/merge/query, if setup failed we must structurally fail this test
|
||||
let db_unwrapped = if test.action.as_str() != "compile" && test.action.as_str() != "database_compile" {
|
||||
let db_unwrapped = if test.action.as_str() != "compile" {
|
||||
match &**db {
|
||||
Ok(valid_db) => Some(valid_db.clone()),
|
||||
Err(drop) => {
|
||||
@ -105,7 +105,7 @@ pub fn run_test_case(path: &str, suite_idx: usize, case_idx: usize) -> Result<()
|
||||
// 4. Run Tests
|
||||
|
||||
match test.action.as_str() {
|
||||
"compile" | "database_compile" => {
|
||||
"compile" => {
|
||||
let result = test.run_compile(db);
|
||||
if let Err(e) = result {
|
||||
println!("TEST COMPILE ERROR FOR '{}': {}", test.description, e);
|
||||
|
||||
@ -50,17 +50,8 @@ fn subset_match(expected: &serde_json::Value, actual: &serde_json::Value) -> boo
|
||||
match (expected, actual) {
|
||||
(serde_json::Value::Object(exp_map), serde_json::Value::Object(act_map)) => {
|
||||
for (k, v) in exp_map {
|
||||
let mut act_v = act_map.get(k);
|
||||
|
||||
// Transparent fallback: if testing legacy flat "path", gracefully check inside "details"
|
||||
if act_v.is_none() && k == "path" {
|
||||
if let Some(serde_json::Value::Object(details)) = act_map.get("details") {
|
||||
act_v = details.get("path");
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(target) = act_v {
|
||||
if !subset_match(v, target) {
|
||||
if let Some(act_v) = act_map.get(k) {
|
||||
if !subset_match(v, act_v) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user