-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
When working on old Advent of Code problems, I was writing up the examples as test cases. To be DRY, I decided to use the test-case
crate:
#[test_case("(())", 0 ; "case 1")]
#[test_case("()()", 0 ; "case 2")]
#[test_case("(((", 3 ; "case 3")]
#[test_case("(((", 3 ; "case 4")]
#[test_case("))(((((", 3 ; "case 5")]
#[test_case("())", -1 ; "case 6")]
#[test_case("))(", -1 ; "case 7")]
#[test_case(")))", -3 ; "case 8")]
#[test_case(")())())", -3 ; "case 9")]
fn example(str_sequence: &str, result: i32) {
let sequence = directions_from_string(str_sequence).unwrap();
assert_eq!(run_1(&sequence), result);
}
Unfortunately, it leads to some pretty unsightly results in the CodeLens:
All of the 'Run fn_name Tests | Debug' options are strung together and not separated, and fly way off the side of the page. If I wanted to use one of them, it would be near impossible to find which of the chunks I'm supposed to click on for which test. I'm not sure if this is more to do with Rust Analyzer or VS Code itself, but since an issue here will get more eyes than one in the VSC repo, it's probably best to start here—if this is not the right place for this issue, please direct me to the right place! Thanks.