Skip to content

Commit

Permalink
Add test to check function signature matches init return type
Browse files Browse the repository at this point in the history
  • Loading branch information
justahero committed Oct 27, 2021
1 parent 00a0a00 commit e04efed
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fn main() {}

#[defmt_test_macros::tests]
mod tests {
#[init]
fn init() {
// empty
}

#[test]
fn test(arg: &mut u8) {
assert!(true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
error: no state was initialized by `#[init]`; signature must be `fn()`
--> tests/ui/test-has-non-empty-signature.rs:11:8
|
11 | fn test(arg: &mut u8) {
| ^^^^

0 comments on commit e04efed

Please sign in to comment.