fix: make tests pass

This commit is contained in:
Jonathan Kelley committed 2022-01-03 01:12:39 -05:00
1 parent 15b72cd7eb
commit 75fa7b4aa6
9 files changed
+116 -25

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ This is the core crate for the Dioxus Virtual DOM. This README will focus on the
To build new apps with Dioxus or to extend the ecosystem with new hooks or components, use the higher-level `dioxus` crate with the appropriate feature flags.
```rust
```rust, ignore
fn app(cx: Scope) -> Element {
rsx!(cx, div { "hello world" })
}
+3 -3
View File
@@ -29,7 +29,7 @@ pub(crate) mod innerlude {
///
/// ## Rust-Style
///
/// ```rust
/// ```rust, ignore
/// fn example(cx: Scope<Props>) -> Element {
/// // ...
/// }
@@ -39,7 +39,7 @@ pub(crate) mod innerlude {
/// )
/// ```
/// ## React-Style
/// ```rust
/// ```rust, ignore
/// fn Example(cx: Scope<Props>) -> Element {
/// // ...
/// }
@@ -52,7 +52,7 @@ pub(crate) mod innerlude {
/// ## As a closure
/// This particular type alias lets you even use static closures for pure/static components:
///
/// ```rust
/// ```rust, ignore
/// static Example: Component<Props> = |cx| {
/// // ...
/// };
+9 -9
View File
@@ -185,7 +185,7 @@ impl VirtualDom {
/// This is useful when the VirtualDom must be driven from outside a thread and it doesn't make sense to wait for the
/// VirtualDom to be created just to retrieve its channel receiver.
///
/// ```rust
/// ```rust, ignore
/// let channel = futures_channel::mpsc::unbounded();
/// let dom = VirtualDom::new_with_scheduler(Example, (), channel);
/// ```
@@ -228,7 +228,7 @@ impl VirtualDom {
///
/// # Example
///
/// ```rust
/// ```rust, ignore
/// let mut dom = VirtualDom::new(example);
/// dom.rebuild();
///
@@ -547,7 +547,7 @@ impl VirtualDom {
///
/// Useful when needing to render nodes from outside the VirtualDom, such as in a test.
///
/// ```rust
/// ```rust, ignore
/// fn Base(cx: Scope) -> Element {
/// rsx!(cx, div {})
/// }
@@ -567,7 +567,7 @@ impl VirtualDom {
///
/// Useful when needing to render nodes from outside the VirtualDom, such as in a test.
///
/// ```rust
/// ```rust, ignore
/// fn Base(cx: Scope) -> Element {
/// rsx!(cx, div {})
/// }
@@ -589,7 +589,7 @@ impl VirtualDom {
/// Useful when needing to render nodes from outside the VirtualDom, such as in a test.
///
///
/// ```rust
/// ```rust, ignore
/// fn Base(cx: Scope) -> Element {
/// rsx!(cx, div {})
/// }
@@ -612,7 +612,7 @@ impl VirtualDom {
/// Useful when needing to diff two rsx! calls from outside the VirtualDom, such as in a test.
///
///
/// ```rust
/// ```rust, ignore
/// fn Base(cx: Scope) -> Element {
/// rsx!(cx, div {})
/// }
@@ -756,7 +756,7 @@ pub enum SchedulerMsg {
/// `Send` will not be lifted. The entire `UserEvent` must also be `Send + Sync` due to its use in the scheduler channel.
///
/// # Example
/// ```rust
/// ```rust, ignore
/// fn App(cx: Scope) -> Element {
/// rsx!(cx, div {
/// onclick: move |_| println!("Clicked!")
@@ -957,7 +957,7 @@ pub fn Fragment<'a>(cx: Scope<'a, FragmentProps<'a>>) -> Element {
/// ## Example
///
/// For props that are 'static:
/// ```rust, ignore ignore
/// ```rust, ignore
/// #[derive(Props, PartialEq)]
/// struct MyProps {
/// data: String
@@ -966,7 +966,7 @@ pub fn Fragment<'a>(cx: Scope<'a, FragmentProps<'a>>) -> Element {
///
/// For props that borrow:
///
/// ```rust, ignore ignore
/// ```rust, ignore
/// #[derive(Props)]
/// struct MyProps<'a >{
/// data: &'a str
+3 -4
View File
@@ -9,13 +9,12 @@ Specifically:
- [ ] Async isn't busted
*/
use dioxus::{prelude::*, DomEdit, SchedulerMsg, ScopeId};
use dioxus::{prelude::*, SchedulerMsg, ScopeId};
use dioxus_core as dioxus;
use dioxus_core_macro::*;
use dioxus_html as dioxus_elements;
mod test_logging;
use DomEdit::*;
const IS_LOGGING_ENABLED: bool = false;
@@ -97,7 +96,7 @@ fn memo_works_properly() {
let name = cx.use_hook(|_| String::from("asd"));
cx.render(rsx!(
div { "Hello, world!" }
div { "Hello, world! {name}" }
child(na: "asdfg".to_string())
))
}
@@ -149,7 +148,7 @@ fn free_works_on_root_props() {
impl Drop for Custom {
fn drop(&mut self) {
dbg!("dropped!");
dbg!("dropped! {}", &self.val);
}
}