aboutsummaryrefslogtreecommitdiff
path: root/common/object/src/tests.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/object/src/tests.rs')
-rw-r--r--common/object/src/tests.rs34
1 files changed, 8 insertions, 26 deletions
diff --git a/common/object/src/tests.rs b/common/object/src/tests.rs
index 616ac69..73f7b6f 100644
--- a/common/object/src/tests.rs
+++ b/common/object/src/tests.rs
@@ -4,19 +4,13 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use crate::{Object, ObjectBuffer, Registry, fields, inspect::Inspector};
-use std::sync::LazyLock;
+use crate::{Object, ObjectBuffer, fields};
-pub static TAGREG: LazyLock<Registry> = LazyLock::new(|| {
- let mut reg = Registry::default();
- register_fields(&mut reg);
- reg
-});
fields! {
- NAME: &str = 15 "name";
- AGE: u32 = 13 "age";
- FRIEND: &str = 54321 "friend";
- STUFF: Object = 3 "stuff";
+ NAME: &str = b"name";
+ AGE: u32 = b"age1";
+ FRIEND: &str = b"frnd";
+ STUFF: Object = b"stff";
}
fn test_object() -> ObjectBuffer {
@@ -86,21 +80,9 @@ fn insert_empty() {
}
#[test]
-fn inspect_object() {
- let bob = test_object();
- eprintln!("{:#?}", Inspector(&TAGREG, bob.as_object()));
- // panic!()
-}
-
-#[test]
-fn inspect_tag() {
- assert_eq!(
- format!("{:?}", Inspector(&TAGREG, FRIEND)),
- "TypedTag<&str>(\"friend\")"
- );
+fn debug() {
assert_eq!(
- format!("{:?}", Inspector(&TAGREG, AGE)),
- "TypedTag<u32>(\"age\")"
+ format!("{:?}", test_object()),
+ "Object { age1: 35, frnd: \"Alice\", frnd: \"Charlie\", name: \"Bob\" }"
);
- assert_eq!(format!("{:?}", Inspector(&TAGREG, NAME.0)), "Tag(\"name\")");
}