Skip to content

Commit

Permalink
fix: Test namespacing
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Oct 25, 2024
1 parent e7ef64e commit 12c326d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lykiadb-server/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#![recursion_limit = "192"]
use util::run_test;
use test_each_file::test_each_file;

mod runtime;
mod util;
mod planner {
use test_each_file::test_each_file;
use crate::util::run_test;

test_each_file! { in "lykiadb-server/tests/planner" => run_test }
test_each_file! { in "lykiadb-server/tests/planner" => run_test }
}
4 changes: 2 additions & 2 deletions lykiadb-server/tests/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use lykiadb_lang::{ast::stmt::Stmt, parser::program::Program};
use lykiadb_server::plan::planner::Planner;
use lykiadb_server::{assert_plan, plan::planner::Planner};
use pretty_assertions::assert_eq;

fn expect_plan(query: &str, expected_plan: &str) {
Expand All @@ -24,6 +24,6 @@ pub fn run_test(input: &str) {
let directives_end = directives_and_input.find('>').unwrap_or(directives_and_input.len());
let rest = directives_and_input[directives_end+1..].trim().to_string();
let io_parts: Vec<&str> = rest.split("---").collect();
expect_plan(&io_parts[0].trim(),&io_parts[1].trim());
expect_plan(&io_parts[0].trim(),&io_parts[1].trim());
}
}

0 comments on commit 12c326d

Please sign in to comment.