Skip to content

Commit

Permalink
Assert more strictly in test_plain_text_fallback()
Browse files Browse the repository at this point in the history
  • Loading branch information
Enselic committed Mar 12, 2022
1 parent 5944ff9 commit 6abd37c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/parsing/syntax_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,10 +1024,16 @@ mod tests {
let syntax = syntax_set.find_syntax_by_extension("z").unwrap();
let mut parse_state = ParseState::new(syntax);
let ops = parse_state.parse_line("z go_x x leave_x z", &syntax_set);
let expected_text_plain = (6, ScopeStackOp::Push(Scope::new("text.plain").unwrap()));
assert_ops_contain(&ops, &expected_text_plain);
let expected_text_plain_pop = (9, ScopeStackOp::Pop(1));
assert_ops_contain(&ops, &expected_text_plain_pop);
let expected_ops = vec![
(0, ScopeStackOp::Push(Scope::new("source.z").unwrap())),
(0, ScopeStackOp::Push(Scope::new("z").unwrap())),
(1, ScopeStackOp::Pop(1)),
(6, ScopeStackOp::Push(Scope::new("text.plain").unwrap())),
(9, ScopeStackOp::Pop(1)),
(17, ScopeStackOp::Push(Scope::new("z").unwrap())),
(18, ScopeStackOp::Pop(1)),
];
assert_eq!(ops, expected_ops);
}

#[test]
Expand Down

0 comments on commit 6abd37c

Please sign in to comment.