Skip to content

Commit

Permalink
Add coverage for report error at macro #211
Browse files Browse the repository at this point in the history
  • Loading branch information
zzau13 committed Jul 19, 2021
1 parent 28ba3b4 commit e07ea7d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
6 changes: 6 additions & 0 deletions yarte/tests/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
fn ui() {
trybuild::TestCases::new().compile_fail("tests/fails/*.rs");
}

#[cfg(any(feature = "bytes-buf", feature = "bytes-buf-tokio2"))]
#[test]
fn proc_ui() {
trybuild::TestCases::new().compile_fail("tests/proc-fails/*.rs");
}
5 changes: 5 additions & 0 deletions yarte/tests/proc-fails/proc-basic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
use yarte::*;

fn main() {
let _ = auto!(ywrite_html!(String, "{{ @foo }}"));
}
13 changes: 13 additions & 0 deletions yarte/tests/proc-fails/proc-basic.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error: proc macro panicked
--> $DIR/proc-basic.rs:4:13
|
4 | let _ = auto!(ywrite_html!(String, "{{ @foo }}"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: error
--> $DIR/__Main__.hbs:1:5
|
1 | {{ @foo }}
| ^^^ Not exist @ helper
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit e07ea7d

Please sign in to comment.