feat(cli): verify assertions for every carat in tests, not just the first one

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
This commit is contained in:
Novus Nota 2024-11-29 05:25:49 +01:00 committed by GitHub
parent 473f0a1a4d
commit e445532a1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 40 additions and 19 deletions

View file

@ -23,7 +23,7 @@ fn test_highlight_test_with_basic_test() {
"// hi",
"var abc = function(d) {",
" // ^ function",
" // ^ keyword",
" // ^^^ keyword",
" return d + e;",
" // ^ variable",
" // ^ !variable",
@ -39,12 +39,12 @@ fn test_highlight_test_with_basic_test() {
assert_eq!(
assertions,
&[
Assertion::new(1, 5, false, String::from("function")),
Assertion::new(1, 11, false, String::from("keyword")),
Assertion::new(4, 9, false, String::from("variable")),
Assertion::new(4, 11, true, String::from("variable")),
Assertion::new(8, 5, false, String::from("function")),
Assertion::new(8, 11, false, String::from("keyword")),
Assertion::new(1, 5, 1, false, String::from("function")),
Assertion::new(1, 11, 3, false, String::from("keyword")),
Assertion::new(4, 9, 1, false, String::from("variable")),
Assertion::new(4, 11, 1, true, String::from("variable")),
Assertion::new(8, 5, 1, false, String::from("function")),
Assertion::new(8, 11, 1, false, String::from("keyword")),
]
);

View file

@ -30,10 +30,10 @@ fn test_tags_test_with_basic_test() {
assert_eq!(
assertions,
&[
Assertion::new(1, 4, false, String::from("definition.function")),
Assertion::new(3, 9, false, String::from("reference.call")),
Assertion::new(5, 11, false, String::from("reference.call")),
Assertion::new(5, 13, true, String::from("variable.parameter")),
Assertion::new(1, 4, 1, false, String::from("definition.function")),
Assertion::new(3, 9, 1, false, String::from("reference.call")),
Assertion::new(5, 11, 1, false, String::from("reference.call")),
Assertion::new(5, 13, 1, true, String::from("variable.parameter")),
]
);