| Index: pkg/analyzer/test/generated/all_the_rest_test.dart
|
| diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| index 25c34650ac60a763244c2b619fa664f213b8480a..9dd08e8ee4c3f6060abf4e720228dbb2c642e480 100644
|
| --- a/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| +++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
|
| @@ -30,6 +30,7 @@ import 'package:analyzer/src/generated/utilities_collection.dart';
|
| import 'package:analyzer/src/generated/utilities_dart.dart';
|
| import 'package:analyzer/src/task/dart.dart';
|
| import 'package:path/path.dart';
|
| +import 'package:source_span/source_span.dart';
|
| import 'package:unittest/unittest.dart';
|
|
|
| import '../reflective_tests.dart';
|
| @@ -7334,6 +7335,27 @@ class ErrorReporterTest extends EngineTestCase {
|
| expect(error.offset, element.nameOffset);
|
| }
|
|
|
| + void test_reportErrorForSpan() {
|
| + GatheringErrorListener listener = new GatheringErrorListener();
|
| + ErrorReporter reporter = new ErrorReporter(listener, new TestSource());
|
| +
|
| + var src = '''
|
| +foo: bar
|
| +zap: baz
|
| +''';
|
| +
|
| + int offset = src.indexOf('baz');
|
| + int length = 'baz'.length;
|
| +
|
| + SourceSpan span = new SourceFile(src).span(offset, offset + length);
|
| +
|
| + reporter.reportErrorForSpan(
|
| + AnalysisOptionsWarningCode.UNSUPPORTED_OPTION, span, ['test', 'zap']);
|
| + expect(listener.errors, hasLength(1));
|
| + expect(listener.errors.first.offset, offset);
|
| + expect(listener.errors.first.length, length);
|
| + }
|
| +
|
| void test_reportTypeErrorForNode_differentNames() {
|
| DartType firstType = createType("/test1.dart", "A");
|
| DartType secondType = createType("/test2.dart", "B");
|
|
|