Skip to content

Commit

Permalink
added more tests for derive(Properties)
Browse files Browse the repository at this point in the history
  • Loading branch information
its-the-shrimp committed Sep 12, 2023
1 parent 471f259 commit 1771ce8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/yew-macro/tests/derive_props/pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ mod t11 {
}
}

mod t12 {
#[derive(::std::clone::Clone, ::yew::Properties, ::std::cmp::PartialEq)]
pub struct Props<T: ::std::clone::Clone + ::std::cmp::PartialEq> {
value: ::std::option::Option<T>,
}

fn optional_prop_generics_should_work() {
::yew::props! { Props::<::std::primitive::bool> { } };
::yew::props! { Props::<::std::primitive::bool> { value: true } };
}
}

#[deny(non_snake_case, dead_code)]
mod t13 {
#[derive(::std::cmp::PartialEq, ::yew::Properties)]
Expand Down

0 comments on commit 1771ce8

Please sign in to comment.