fix create fuzzing test
This commit is contained in:
1 parent
a1c68448a7
commit
4c5a311191
2 files changed
+8
-6
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use dioxus::core::Mutation::*;
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_core::ElementId;
|
||||
use dioxus_core::{ElementId, NoOpMutations};
|
||||
|
||||
#[test]
|
||||
fn text_diff() {
|
||||
@@ -10,7 +10,7 @@ fn text_diff() {
|
||||
}
|
||||
|
||||
let mut vdom = VirtualDom::new(app);
|
||||
_ = vdom.rebuild_to_vec();
|
||||
vdom.rebuild(&mut NoOpMutations);
|
||||
|
||||
vdom.mark_dirty(ScopeId::ROOT);
|
||||
assert_eq!(
|
||||
@@ -44,7 +44,7 @@ fn element_swap() {
|
||||
}
|
||||
|
||||
let mut vdom = VirtualDom::new(app);
|
||||
_ = vdom.rebuild_to_vec();
|
||||
vdom.rebuild(&mut NoOpMutations);
|
||||
|
||||
vdom.mark_dirty(ScopeId::ROOT);
|
||||
assert_eq!(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#![cfg(not(miri))]
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_core::{prelude::EventHandler, AttributeValue, DynamicNode, VComponent, VNode, *};
|
||||
use dioxus_core::{
|
||||
prelude::EventHandler, AttributeValue, DynamicNode, NoOpMutations, VComponent, VNode, *,
|
||||
};
|
||||
use std::{cfg, collections::HashSet, default::Default};
|
||||
|
||||
fn random_ns() -> Option<&'static str> {
|
||||
@@ -281,7 +283,7 @@ fn create() {
|
||||
for _ in 0..repeat_count {
|
||||
let mut vdom =
|
||||
VirtualDom::new_with_props(create_random_element, DepthProps { depth: 0, root: true });
|
||||
let _ = vdom.rebuild_to_vec();
|
||||
vdom.rebuild(&mut NoOpMutations);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -293,7 +295,7 @@ fn diff() {
|
||||
for _ in 0..repeat_count {
|
||||
let mut vdom =
|
||||
VirtualDom::new_with_props(create_random_element, DepthProps { depth: 0, root: true });
|
||||
let _ = vdom.rebuild_to_vec();
|
||||
vdom.rebuild(&mut NoOpMutations);
|
||||
// A list of all elements that have had event listeners
|
||||
// This is intentionally never cleared, so that we can test that calling event listeners that are removed doesn't cause a panic
|
||||
let mut event_listeners = HashSet::new();
|
||||
|
||||
Reference in new issue
Block a user