Index: test/span_test.dart |
diff --git a/test/span_test.dart b/test/span_test.dart |
index 39b0b9433ddc779998867a97ec8ebd60f77e7575..34d017446536b38d128fd8863ca562f012ea02a5 100644 |
--- a/test/span_test.dart |
+++ b/test/span_test.dart |
@@ -65,6 +65,21 @@ main() { |
new SourceSpanWithContext(start, end, "abc", "\n---abc--"); |
new SourceSpanWithContext(start, end, "abc", "\n\n---abc--"); |
}); |
+ |
+ test('text can occur multiple times in context', () { |
+ var start1 = new SourceLocation(4, line: 55, column: 2); |
+ var end1 = new SourceLocation(7, line: 55, column: 5); |
+ var start2 = new SourceLocation(4, line: 55, column: 8); |
+ var end2 = new SourceLocation(7, line: 55, column: 11); |
+ new SourceSpanWithContext(start1, end1, "abc", "--abc---abc--\n"); |
+ new SourceSpanWithContext(start1, end1, "abc", "--abc--abc--\n"); |
+ new SourceSpanWithContext(start2, end2, "abc", "--abc---abc--\n"); |
+ new SourceSpanWithContext(start2, end2, "abc", "---abc--abc--\n"); |
+ expect(() => new SourceSpanWithContext( |
+ start1, end1, "abc", "---abc--abc--\n"), throwsArgumentError); |
+ expect(() => new SourceSpanWithContext( |
+ start2, end2, "abc", "--abc--abc--\n"), throwsArgumentError); |
+ }); |
}); |
group('for union()', () { |