aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/tests
diff options
context:
space:
mode:
Diffstat (limited to 'mingling_core/tests')
-rw-r--r--mingling_core/tests/test-all/tests/integration.rs17
-rw-r--r--mingling_core/tests/test-basic/tests/integration.rs2
-rw-r--r--mingling_core/tests/test-dispatch-tree/tests/integration.rs2
-rw-r--r--mingling_core/tests/test-repl/tests/integration.rs2
-rw-r--r--mingling_core/tests/test-structural-renderer/tests/integration.rs8
5 files changed, 18 insertions, 13 deletions
diff --git a/mingling_core/tests/test-all/tests/integration.rs b/mingling_core/tests/test-all/tests/integration.rs
index 3581702..d36b9df 100644
--- a/mingling_core/tests/test-all/tests/integration.rs
+++ b/mingling_core/tests/test-all/tests/integration.rs
@@ -1,13 +1,12 @@
use mingling::Flag;
-use mingling::StructuralRenderer;
-use mingling::StructuralRendererSetting;
-use mingling::MockProgramCollect;
use mingling::NextProcess;
-use mingling::StructuralData;
use mingling::Node;
use mingling::Program;
use mingling::RenderResult;
use mingling::StringVec;
+use mingling::StructuralData;
+use mingling::StructuralRenderer;
+use mingling::StructuralRendererSetting;
use mingling::comp::{ShellContext, ShellFlag, Suggest};
use mingling::core_res::ResREPL;
use mingling::hook::ProgramHook;
@@ -86,7 +85,7 @@ fn test_render_result_default() {
fn test_render_result_print() {
let mut r = RenderResult::default();
r.print("hello");
- assert_eq!(&*r, "hello");
+ assert_eq!(r.to_string().as_str(), "hello");
}
// StructuralRenderer
@@ -125,13 +124,13 @@ fn test_structural_renderer_json() {
#[test]
fn test_is_completing() {
- let program: Program<MockProgramCollect> = Program::new_with_args(["app", "__comp"]);
+ let program: Program<crate::ThisProgram> = Program::new_with_args(["app", "__comp"]);
assert!(program.is_completing());
}
#[test]
fn test_is_not_completing() {
- let program: Program<MockProgramCollect> = Program::new_with_args(["app", "greet"]);
+ let program: Program<crate::ThisProgram> = Program::new_with_args(["app", "greet"]);
assert!(!program.is_completing());
}
@@ -141,7 +140,7 @@ fn test_is_not_completing() {
fn test_hook_setup() {
static CALLED: AtomicBool = AtomicBool::new(false);
- let hook = ProgramHook::<MockProgramCollect>::empty().on_begin::<_, ()>(|_| {
+ let hook = ProgramHook::<crate::ThisProgram>::empty().on_begin::<_, ()>(|_| {
CALLED.store(true, Ordering::SeqCst);
});
@@ -166,3 +165,5 @@ fn test_string_vec_from_array() {
let v: Vec<String> = sv.into();
assert_eq!(v, vec!["a", "b", "c"]);
}
+
+mingling::macros::gen_program!();
diff --git a/mingling_core/tests/test-basic/tests/integration.rs b/mingling_core/tests/test-basic/tests/integration.rs
index 7cd7b8c..e51992c 100644
--- a/mingling_core/tests/test-basic/tests/integration.rs
+++ b/mingling_core/tests/test-basic/tests/integration.rs
@@ -60,7 +60,7 @@ fn test_render_result_default() {
fn test_render_result_print() {
let mut r = RenderResult::default();
r.print("hello");
- assert_eq!(&*r, "hello");
+ assert_eq!(r.to_string().as_str(), "hello");
}
#[test]
diff --git a/mingling_core/tests/test-dispatch-tree/tests/integration.rs b/mingling_core/tests/test-dispatch-tree/tests/integration.rs
index 7cd7b8c..e51992c 100644
--- a/mingling_core/tests/test-dispatch-tree/tests/integration.rs
+++ b/mingling_core/tests/test-dispatch-tree/tests/integration.rs
@@ -60,7 +60,7 @@ fn test_render_result_default() {
fn test_render_result_print() {
let mut r = RenderResult::default();
r.print("hello");
- assert_eq!(&*r, "hello");
+ assert_eq!(r.to_string().as_str(), "hello");
}
#[test]
diff --git a/mingling_core/tests/test-repl/tests/integration.rs b/mingling_core/tests/test-repl/tests/integration.rs
index 1792525..4de0e8f 100644
--- a/mingling_core/tests/test-repl/tests/integration.rs
+++ b/mingling_core/tests/test-repl/tests/integration.rs
@@ -59,5 +59,5 @@ fn test_render_result_default() {
fn test_render_result_print() {
let mut r = RenderResult::default();
r.print("hello");
- assert_eq!(&*r, "hello");
+ assert_eq!(r.to_string().as_str(), "hello");
}
diff --git a/mingling_core/tests/test-structural-renderer/tests/integration.rs b/mingling_core/tests/test-structural-renderer/tests/integration.rs
index 3c3c6db..e4057f8 100644
--- a/mingling_core/tests/test-structural-renderer/tests/integration.rs
+++ b/mingling_core/tests/test-structural-renderer/tests/integration.rs
@@ -1,4 +1,4 @@
-use mingling::{StructuralRenderer, StructuralRendererSetting, RenderResult, StructuralData};
+use mingling::{RenderResult, StructuralData, StructuralRenderer, StructuralRendererSetting};
use serde::Serialize;
#[derive(Debug, Clone, PartialEq, Serialize, StructuralData)]
@@ -17,7 +17,8 @@ fn test_data() -> TestData {
#[test]
fn test_render_disable() {
let mut r = RenderResult::default();
- let result = StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Disable, &mut r);
+ let result =
+ StructuralRenderer::render(&test_data(), &StructuralRendererSetting::Disable, &mut r);
assert!(result.is_ok());
assert!(r.is_empty());
}
@@ -73,3 +74,6 @@ fn test_render_ron() {
assert!(output.contains("value:"));
assert!(output.contains("42"));
}
+
+mingling::macros::gen_program!();
+