wip: move everything over to a stack dst

This commit is contained in:
Jonathan Kelley committed 2021-10-29 17:12:30 -04:00
1 parent 12a9758c3c
commit 0e9d5fc530
36 files changed
+224 -185

No files matched your search

+16 -16
View File
@@ -22,13 +22,13 @@ fn new_dom<P: 'static + Send>(app: FC<P>, props: P) -> VirtualDom {
#[test]
fn test_original_diff() {
static APP: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
div {
div {
"Hello, world!"
}
}
})
}
};
let mut dom = new_dom(APP, ());
@@ -58,7 +58,7 @@ fn test_original_diff() {
#[test]
fn create() {
static APP: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
div {
div {
"Hello, world!"
@@ -72,7 +72,7 @@ fn create() {
}
}
}
})
}
};
let mut dom = new_dom(APP, ());
@@ -121,11 +121,11 @@ fn create() {
#[test]
fn create_list() {
static APP: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
{(0..3).map(|f| rsx!{ div {
"hello"
}})}
})
}
};
let mut dom = new_dom(APP, ());
@@ -170,12 +170,12 @@ fn create_list() {
#[test]
fn create_simple() {
static APP: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
div {}
div {}
div {}
div {}
})
}
};
let mut dom = new_dom(APP, ());
@@ -208,19 +208,19 @@ fn create_simple() {
#[test]
fn create_components() {
static App: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
Child { "abc1" }
Child { "abc2" }
Child { "abc3" }
})
}
};
static Child: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
h1 {}
div { {cx.children()} }
p {}
})
}
};
let mut dom = new_dom(App, ());
@@ -269,10 +269,10 @@ fn create_components() {
#[test]
fn anchors() {
static App: FC<()> = |(cx, props)| {
cx.render(rsx! {
rsx! {
{true.then(|| rsx!{ div { "hello" } })}
{false.then(|| rsx!{ div { "goodbye" } })}
})
}
};
let mut dom = new_dom(App, ());
@@ -303,9 +303,9 @@ fn suspended() {
|| async {
//
},
|cx, p| cx.render(rsx! { "hi "}),
|cx, p| rsx! { "hi "},
);
cx.render(rsx! { {val} })
rsx! { {val} }
};
let mut dom = new_dom(App, ());