Skip to content

Commit

Permalink
chore: migrate to Rust edition 2021
Browse files Browse the repository at this point in the history
 A logical choice now, since our dependencies also require Rust 1.56, for edition 2021, and in a previous commit, the MSRV was set to 1.56 already.
  • Loading branch information
foresterre committed Oct 12, 2023
1 parent c5d419e commit f4bb10b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "parameterized"
version = "1.0.1"
authors = ["Martijn Gribnau <[email protected]>"]
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "Procedural macro which brings a compact parameterized testing implementation to Rust (inspired by JUnit @ParameterizedTest)"
documentation = "https://docs.rs/crate/parameterized"
Expand Down
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,17 @@ mod tests {

Ok(())
}

#[pm(v = {
Ok(1),
// Err("Oh noes".to_string()), // Implements Termination, and reports the exit code: ExitCode::FAILURE, causing the test to fail! Uncomment line to see the result
})]
fn readme_example(v: Result<u32, String>) -> Result<(), String> {
let value = v?; // Can use the question mark operator here, since return type is Result, which implements the Termination trait

assert_eq!(value, 1);

Ok(())
}
}
}

0 comments on commit f4bb10b

Please sign in to comment.