wip: move from recursive to iterative

This commit is contained in:
Jonathan Kelley committed 2021-08-19 02:50:35 -04:00
1 parent f41cff571f
commit 9652ccdcf1
4 files changed
+2173 -29

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
//! tests to prove that the iterative implementation works
use anyhow::{Context, Result};
use dioxus::{
arena::SharedResources,
diff::{CreateMeta, DiffMachine},
prelude::*,
scheduler::Mutations,
DomEdit,
};
use dioxus_core as dioxus;
use dioxus_html as dioxus_elements;
#[test]
fn test_original_diff() {
static App: FC<()> = |cx| {
cx.render(rsx! {
div {
div {
"Hello, world!"
}
}
})
};
let mut dom = VirtualDom::new(App);
let mutations = dom.rebuild().unwrap();
dbg!(mutations);
}
#[async_std::test]
async fn test_iterative_diff() {
static App: FC<()> = |cx| {
cx.render(rsx! {
div {
div {
"Hello, world!"
}
}
})
};
let shared = SharedResources::new();
let mut machine = DiffMachine::new_headless(&shared);
let a = machine.work().await.unwrap();
}