aboutsummaryrefslogtreecommitdiff
path: root/common/object/src/tests.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2026-01-14 22:12:50 +0100
committermetamuffin <metamuffin@disroot.org>2026-01-14 22:12:50 +0100
commit314b9cf6eddda6d0a3c5bd153e960873622224b1 (patch)
tree02c0476874fb9de60c6a1f99cb33f07530cf1f1e /common/object/src/tests.rs
parentabf25f340c11111369b69c13c34d8fed9d4f0da8 (diff)
downloadjellything-314b9cf6eddda6d0a3c5bd153e960873622224b1.tar
jellything-314b9cf6eddda6d0a3c5bd153e960873622224b1.tar.bz2
jellything-314b9cf6eddda6d0a3c5bd153e960873622224b1.tar.zst
object inspect tag
Diffstat (limited to 'common/object/src/tests.rs')
-rw-r--r--common/object/src/tests.rs19
1 files changed, 16 insertions, 3 deletions
diff --git a/common/object/src/tests.rs b/common/object/src/tests.rs
index 6ffa9e5..59e6d8c 100644
--- a/common/object/src/tests.rs
+++ b/common/object/src/tests.rs
@@ -4,7 +4,7 @@
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
-use crate::{ObjectBuffer, Registry, fields, inspect::ObjectInpector};
+use crate::{ObjectBuffer, Registry, fields, inspect::Inspector};
use std::sync::LazyLock;
pub static TAGREG: LazyLock<Registry> = LazyLock::new(|| {
@@ -76,8 +76,21 @@ fn insert() {
}
#[test]
-fn inspect() {
+fn inspect_object() {
let bob = test_object();
- eprintln!("{:#?}", ObjectInpector(&TAGREG, bob.as_object()));
+ eprintln!("{:#?}", Inspector(&TAGREG, bob.as_object()));
// panic!()
}
+
+#[test]
+fn inspect_tag() {
+ assert_eq!(
+ format!("{:?}", Inspector(&TAGREG, FRIEND)),
+ "TypedTag<&str>(\"friend\")"
+ );
+ assert_eq!(
+ format!("{:?}", Inspector(&TAGREG, AGE)),
+ "TypedTag<u32>(\"age\")"
+ );
+ assert_eq!(format!("{:?}", Inspector(&TAGREG, NAME.0)), "Tag(\"name\")");
+}