parameterized
parameterized copied to clipboard
🐑 JUnit style parameterized testing for Rust
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start)...
Add: ``` #[parameterized( )] ```
``` /// FIXME: /// Create individual test cases which are recognized by intellij as tests, similar to the ide!() /// macro, but for individual test cases. /// /// ```rust ///...
Current: ```rust #[parameterized( text = { "aaa", "bab", "😃bc" }, expected = { 'a', 'b', '😃' } )] fn test_peek_first_chars(text: &str, expected: char) { assert_eq!(text.peek_first(), expected); } ``` declared case...
**Overview:** Add an input method based on any function which returns `impl IntoIterator` where the type of `V` is of the same type as a function argument. For example for...
The following code will obvisouly fail, since our function has two inputs, but in our attribute, we only provide one. ``` #[parameterized(input = { &["03579", "0", "1", "1"] })] fn...
background info: * https://docs.rs/syn/1.0.7/syn/parse/struct.ParseBuffer.html#method.error * https://docs.rs/syn/1.0.7/syn/struct.Error.html#method.to_compile_error * https://doc.rust-lang.org/std/macro.compile_error.html
**test tests/fail/square_brackets.rs** ... mismatch ``` EXPECTED: ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ error: expected curly braces --> $DIR/square_brackets.rs:3:21 | 3 | #[parameterized(v = [1, 2, 3])] | ^^^^^^^^^ ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ ACTUAL OUTPUT: ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ error: expected curly...
Consider this example: ```rust fn foo(s: &str) -> String { format!("foo: {}", s) }; #[cfg(test)] mod tests { #[allow(unused_imports)] // required for usage in #parametrized. use crate::foo::foo; use anyhow::Result; #[parameterized(...