feat: finalize the Hemx 0.4 core
CI / test (push) Has been cancelled

This commit is contained in:
tmk241
2026-09-02 17:28:40 +02:00
parent 1dc9734f16
commit a3c72e21db
15 changed files with 96 additions and 231 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "hemx-test"
version = "0.4.0"
version = "0.5.0"
edition.workspace = true
rust-version.workspace = true
license.workspace = true
-1
View File
@@ -300,7 +300,6 @@ impl Error for HtmlInspectionError {}
fn resource_attribute(kind: ResourceKind) -> &'static str {
match kind {
ResourceKind::Slot => "data-hemx-resource",
ResourceKind::Atom => "data-hemx-resource",
ResourceKind::Handle => "data-hemx-action",
ResourceKind::Form => "data-hemx-resource",
}
+1 -5
View File
@@ -9,7 +9,7 @@ pub use html::{HtmlElement, HtmlInspectionError, HtmlInspector, HtmlSelection};
pub use process::{ProcessError, ProcessFailure, TestProcess, TestProcessBuilder};
use hemx_core::{
Atom, BuildFingerprint, Effect, EffectBatch, Form, GeneratedTarget, IntoEffect, KeyedSlot,
BuildFingerprint, Effect, EffectBatch, Form, GeneratedTarget, IntoEffect, KeyedSlot,
ResourceId, ResourceRef, ScopeKey, Slot,
};
use std::future::Future;
@@ -465,10 +465,6 @@ impl EffectInspector {
self.has_resource(slot.id())
}
pub fn has_atom<T>(&self, atom: Atom<T>) -> bool {
self.has_resource(atom.id())
}
pub fn has_form<T>(&self, form: Form<T>) -> bool {
self.has_resource(form.id())
}
+3 -7
View File
@@ -1,7 +1,6 @@
use hemx_core::{
Atom, BuildFingerprint, Effect, EffectBatch, Form, GeneratedTarget, HistoryMode,
InsertPosition, KeyedSlot, PatchMode, ResourceId, ResourceKind, ResourceRef, SafeHtml,
ScopeKey, Slot,
BuildFingerprint, Effect, EffectBatch, Form, GeneratedTarget, HistoryMode, InsertPosition,
KeyedSlot, PatchMode, ResourceId, ResourceKind, ResourceRef, SafeHtml, ScopeKey, Slot,
};
#[derive(Clone, Copy)]
@@ -30,12 +29,10 @@ fn panic_text<T>(result: std::thread::Result<T>) -> String {
#[test]
fn inspects_tuple_effects() {
let count = Slot::<u32>::new(1);
let user = Atom::<String>::new(2);
let inspected = hemx_test::run(|value| (count.text(value), user.set("alice")), 42);
let inspected = hemx_test::run(|value| count.text(value), 42);
assert!(inspected.has_slot(count));
assert!(inspected.has_atom(user));
assert!(inspected.contains(&Effect::Patch {
target: ResourceRef::unscoped(count.id()),
mode: PatchMode::Morph,
@@ -227,7 +224,6 @@ fn inspector_predicates_bind_operation_target_scope_kind_and_payload() {
assert!(!inspected.has_slot(Slot::<()>::new(99)));
assert!(inspected.has_keyed_slot(KeyedSlot::<String, ()>::new(42)));
assert!(!inspected.has_keyed_slot(KeyedSlot::<String, ()>::new(99)));
assert!(!inspected.has_atom(Atom::<()>::new(42)));
assert!(inspected.has_form(form));
assert!(!inspected.has_form(Form::<()>::new(12)));