You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use test_case crate with insta, I get wrong test name results and the tests are not passing when I don't modify the code and re-run them
Minimal reproducing example:
Cargo.toml:
[package]
name = "insta-suggestion"version = "0.1.0"edition = "2021"
[dependencies]
test-case = "3.3"insta = { version = "1.41", features = ["yaml"] }
lib.rs:
use insta::assert_yaml_snapshot;use test_case::test_case;pubfnto_upper_case(text:&str) -> String{
text.to_uppercase()}#[test_case("Hello World" ; "test_hello_world")]#[test_case("Insta is fun" ; "test_insta_is_fun")]fntest_function(text:&str){let res = to_upper_case(text);assert_yaml_snapshot!(res);}
What happens
Running cargo test will create two files:
insta_suggestion__function-2.snap.new
and
insta_suggestion__function.snap.new
If I re-run cargo test, it will fail everytime
Expected output
The two files created should have the right name with "test_hello_world" and "test_insta_is_fun" instead of "test_function"
Aditionaly, if we re-run cargo test without changing anything, the tests shouldn't fail
Why this would be a good features
Pros
insta seems to be a crate designed to write tests faster, test_case also. It would be amazing to combine both and be able to write lots of tests very fast
Cons
Some features, specially with the @"" keyword or the vscode extension will be hard to work with
The text was updated successfully, but these errors were encountered:
Hello,
When I use test_case crate with insta, I get wrong test name results and the tests are not passing when I don't modify the code and re-run them
Minimal reproducing example:
Cargo.toml:
lib.rs:
What happens
Running cargo test will create two files:
insta_suggestion__function-2.snap.new
and
insta_suggestion__function.snap.new
If I re-run cargo test, it will fail everytime
Expected output
The two files created should have the right name with "test_hello_world" and "test_insta_is_fun" instead of "test_function"
Aditionaly, if we re-run cargo test without changing anything, the tests shouldn't fail
Why this would be a good features
Pros
insta seems to be a crate designed to write tests faster, test_case also. It would be amazing to combine both and be able to write lots of tests very fast
Cons
Some features, specially with the @"" keyword or the vscode extension will be hard to work with
The text was updated successfully, but these errors were encountered: