| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library engine.all_the_rest_test; | 5 library engine.all_the_rest_test; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/physical_file_system.dart'; | 7 import 'package:analyzer/file_system/physical_file_system.dart'; |
| 8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; | 8 import 'package:analyzer/src/generated/ast.dart' hide ConstantEvaluator; |
| 9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 7332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7343 foo: bar | 7343 foo: bar |
| 7344 zap: baz | 7344 zap: baz |
| 7345 '''; | 7345 '''; |
| 7346 | 7346 |
| 7347 int offset = src.indexOf('baz'); | 7347 int offset = src.indexOf('baz'); |
| 7348 int length = 'baz'.length; | 7348 int length = 'baz'.length; |
| 7349 | 7349 |
| 7350 SourceSpan span = new SourceFile(src).span(offset, offset + length); | 7350 SourceSpan span = new SourceFile(src).span(offset, offset + length); |
| 7351 | 7351 |
| 7352 reporter.reportErrorForSpan( | 7352 reporter.reportErrorForSpan( |
| 7353 AnalysisOptionsWarningCode.UNSUPPORTED_OPTION, span, ['test', 'zap']); | 7353 AnalysisOptionsWarningCode.UNSUPPORTED_OPTION_WITH_LEGAL_VALUE, |
| 7354 span, |
| 7355 ['test', 'zip', 'zap']); |
| 7354 expect(listener.errors, hasLength(1)); | 7356 expect(listener.errors, hasLength(1)); |
| 7355 expect(listener.errors.first.offset, offset); | 7357 expect(listener.errors.first.offset, offset); |
| 7356 expect(listener.errors.first.length, length); | 7358 expect(listener.errors.first.length, length); |
| 7357 } | 7359 } |
| 7358 | 7360 |
| 7359 void test_reportTypeErrorForNode_differentNames() { | 7361 void test_reportTypeErrorForNode_differentNames() { |
| 7360 DartType firstType = createType("/test1.dart", "A"); | 7362 DartType firstType = createType("/test1.dart", "A"); |
| 7361 DartType secondType = createType("/test2.dart", "B"); | 7363 DartType secondType = createType("/test2.dart", "B"); |
| 7362 GatheringErrorListener listener = new GatheringErrorListener(); | 7364 GatheringErrorListener listener = new GatheringErrorListener(); |
| 7363 ErrorReporter reporter = | 7365 ErrorReporter reporter = |
| (...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9423 if (_expectedExternalScriptName == null) { | 9425 if (_expectedExternalScriptName == null) { |
| 9424 expect(scriptSource, isNull, reason: "script $scriptIndex"); | 9426 expect(scriptSource, isNull, reason: "script $scriptIndex"); |
| 9425 } else { | 9427 } else { |
| 9426 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); | 9428 expect(scriptSource, isNotNull, reason: "script $scriptIndex"); |
| 9427 String actualExternalScriptName = scriptSource.shortName; | 9429 String actualExternalScriptName = scriptSource.shortName; |
| 9428 expect(actualExternalScriptName, _expectedExternalScriptName, | 9430 expect(actualExternalScriptName, _expectedExternalScriptName, |
| 9429 reason: "script $scriptIndex"); | 9431 reason: "script $scriptIndex"); |
| 9430 } | 9432 } |
| 9431 } | 9433 } |
| 9432 } | 9434 } |
| OLD | NEW |