Skip to content

Commit 8eefa04

Browse files
committed
Add a test covering the highlighting of non-contiguous spans
1 parent 93276f5 commit 8eefa04

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pkgs/source_span/test/multiple_highlight_test.dart

+16
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@ gibble bibble bop
4444
'"""));
4545
});
4646

47+
test('highlights non contiguous spans', () {
48+
expect(
49+
file.span(17, 21).highlightMultiple(
50+
'one', {file.span(60, 66): 'two', file.span(4, 7): 'three'}),
51+
equals("""
52+
,
53+
1 | foo bar baz
54+
| === three
55+
2 | whiz bang boom
56+
| ^^^^ one
57+
... |
58+
5 | argle bargle boo
59+
| ====== two
60+
'"""));
61+
});
62+
4763
test('highlights spans on the same line', () {
4864
expect(
4965
file.span(17, 21).highlightMultiple(

0 commit comments

Comments
 (0)