Skip to content

Commit

Permalink
Add a test covering the highlighting of non-contiguous spans
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Dec 11, 2024
1 parent 5590447 commit 7acac5b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pkgs/source_span/test/multiple_highlight_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,22 @@ gibble bibble bop
'"""));
});

test('highlights non contiguous spans', () {
expect(
file.span(17, 21).highlightMultiple(
'one', {file.span(31, 34): 'two', file.span(60, 66): 'three'}),
equals("""
,
1 | foo bar baz
| === three
2 | whiz bang boom
| ^^^^ one
... |
5 | argle bargle boo
| ====== two
'"""));
});

test('highlights spans on the same line', () {
expect(
file.span(17, 21).highlightMultiple(
Expand Down

0 comments on commit 7acac5b

Please sign in to comment.