Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Dec 7, 2019
1 parent 3b23e07 commit 7f596fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
15 changes: 9 additions & 6 deletions tests/macro/html-tag-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,6 @@ error: only one `class` attribute allowed
23 | html! { <div class="first" class="second" /> };
| ^^^^^

error: `onclick` attribute value should be a closure
--> $DIR/html-tag-fail.rs:32:20
|
32 | html! { <input onclick=1 /> };
| ^^^^^^^

error: there must be one closure argument
--> $DIR/html-tag-fail.rs:33:28
|
Expand Down Expand Up @@ -190,6 +184,15 @@ error[E0277]: the trait bound `yew::html::Href: std::convert::From<()>` is not s
<yew::html::Href as std::convert::From<std::string::String>>
= note: required because of the requirements on the impl of `std::convert::Into<yew::html::Href>` for `()`

error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:32:20
|
32 | html! { <input onclick=1 /> };
| ^^^^^^^ expected struct `yew::callback::Callback`, found integer
|
= note: expected type `yew::callback::Callback<stdweb::webapi::events::mouse::ClickEvent>`
found type `{integer}`

error[E0599]: no method named `to_string` found for type `NotToString` in the current scope
--> $DIR/html-tag-fail.rs:37:27
|
Expand Down
3 changes: 3 additions & 0 deletions tests/macro/html-tag-pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
mod helpers;

pass_helper! {
let onclick = Callback::from(|_: ClickEvent| ());
let parent_ref = NodeRef::default();
html! {
<div>
Expand Down Expand Up @@ -37,6 +38,8 @@ pass_helper! {
<img class=("avatar", "hidden") src="http://pic.com" />
<img class="avatar hidden", />
<button onclick=|e| panic!(e) />
<button onclick=&onclick />
<button onclick=onclick />
<a href="http://google.com" />
<custom-tag-a>
<custom-tag-b />
Expand Down

0 comments on commit 7f596fb

Please sign in to comment.