dont spawn a runtime in machine; inherit from outside with runtime::handle::Current

This commit is contained in:
Joshua Parkin
2023-08-03 16:22:03 +01:00
parent 3ff02da314
commit 65eb93793c
4 changed files with 24 additions and 19 deletions

View File

@@ -69,8 +69,8 @@ mod tests {
use super::*;
use crate::machine::{QueryMatch, Value, QueryResolution};
#[test]
fn programatic_query() {
#[tokio::test]
async fn programatic_query() {
let mut machine = Machine::new_lib();
machine.load_module_string(
@@ -108,8 +108,8 @@ mod tests {
);
}
#[test]
fn failing_query() {
#[tokio::test]
async fn failing_query() {
let mut machine = Machine::new_lib();
let query = String::from(r#"triple("a",P,"b")."#);
let output = machine.run_query(query);
@@ -119,8 +119,8 @@ mod tests {
);
}
#[test]
fn complex_results() {
#[tokio::test]
async fn complex_results() {
let mut machine = Machine::new_lib();
machine.load_module_string(
"facts",
@@ -172,8 +172,8 @@ mod tests {
}
#[test]
fn consult() {
#[tokio::test]
async fn consult() {
let mut machine = Machine::new_lib();
machine.consult_module_string(