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..e23b92123534ea40b57c27f5ff1686dc3f77678e 100644 |
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart |
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart |
@@ -31,6 +31,7 @@ import 'package:analyzer/src/generated/utilities_dart.dart'; |
import 'package:analyzer/src/task/dart.dart'; |
import 'package:path/path.dart'; |
import 'package:unittest/unittest.dart'; |
+import 'package:yaml/yaml.dart'; |
import '../reflective_tests.dart'; |
import '../utils.dart'; |
@@ -7299,6 +7300,27 @@ class ErrorReporterTest extends EngineTestCase { |
return element.type; |
} |
+ void test_reportErrorForSpan() { |
+ GatheringErrorListener listener = new GatheringErrorListener(); |
+ ErrorReporter reporter = new ErrorReporter( |
+ listener, |
+ new NonExistingSource( |
Brian Wilkerson
2015/10/22 00:13:00
It's not a problem for this test because you're no
|
+ '/test.yaml', toUri('/test.yaml'), UriKind.FILE_URI)); |
+ |
+ var src = ''' |
+foo: bar |
+zap: baz |
+'''; |
+ |
+ YamlMap node = loadYamlNode(src); |
+ YamlNode bazNode = node.nodes['zap']; |
scheglov
2015/10/21 23:47:21
I think YAML adds extra complexity here.
Why not c
pquitslund
2015/10/21 23:56:57
Mainly because I want to ensure that the spans tha
Brian Wilkerson
2015/10/22 00:13:00
Technically, testing whether the yaml parser produ
|
+ reporter.reportErrorForSpan(AnalysisOptionsWarningCode.UNSUPPORTED_OPTION, |
+ bazNode.span, ['test', 'zap']); |
+ expect(listener.errors, hasLength(1)); |
+ expect(listener.errors.first.offset, src.indexOf('baz')); |
+ expect(listener.errors.first.length, 'baz'.length); |
+ } |
+ |
void test_creation() { |
GatheringErrorListener listener = new GatheringErrorListener(); |
TestSource source = new TestSource(); |