| Index: pkg/analysis_server/test/operation/operation_analysis_test.dart
|
| diff --git a/pkg/analysis_server/test/operation/operation_analysis_test.dart b/pkg/analysis_server/test/operation/operation_analysis_test.dart
|
| deleted file mode 100644
|
| index ee6dc811b2d9c4ae224ae94da5c40dab7c51814b..0000000000000000000000000000000000000000
|
| --- a/pkg/analysis_server/test/operation/operation_analysis_test.dart
|
| +++ /dev/null
|
| @@ -1,100 +0,0 @@
|
| -// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
|
| -// for details. All rights reserved. Use of this source code is governed by a
|
| -// BSD-style license that can be found in the LICENSE file.
|
| -
|
| -library test.operation.analysis;
|
| -
|
| -import 'package:analysis_server/src/operation/operation_analysis.dart';
|
| -import 'package:analysis_services/constants.dart';
|
| -import 'package:analysis_testing/mocks.dart';
|
| -import 'package:analysis_testing/reflective_tests.dart';
|
| -import 'package:analyzer/src/generated/error.dart';
|
| -import 'package:analyzer/src/generated/source.dart';
|
| -import 'package:typed_mock/typed_mock.dart';
|
| -import 'package:unittest/unittest.dart';
|
| -
|
| -
|
| -main() {
|
| - groupSep = ' | ';
|
| - runReflectiveTests(Test_errorToJson);
|
| -}
|
| -
|
| -
|
| -class AnalysisErrorMock extends TypedMock implements AnalysisError {
|
| - noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
|
| -}
|
| -
|
| -
|
| -@ReflectiveTestCase()
|
| -class Test_errorToJson {
|
| - Source source = new MockSource();
|
| - LineInfo lineInfo;
|
| - AnalysisError analysisError = new AnalysisErrorMock();
|
| -
|
| - void setUp() {
|
| - // prepare Source
|
| - when(source.fullName).thenReturn('foo.dart');
|
| - // prepare LineInfo
|
| - lineInfo = new LineInfo([0, 5, 9, 20]);
|
| - // prepare AnalysisError
|
| - when(analysisError.source).thenReturn(source);
|
| - when(analysisError.errorCode).thenReturn(
|
| - CompileTimeErrorCode.AMBIGUOUS_EXPORT);
|
| - when(analysisError.message).thenReturn('my message');
|
| - when(analysisError.offset).thenReturn(10);
|
| - when(analysisError.length).thenReturn(20);
|
| - }
|
| -
|
| - void tearDown() {
|
| - source = null;
|
| - analysisError = null;
|
| - }
|
| -
|
| - void test_noCorrection() {
|
| - Map<String, Object> json = errorToJson(lineInfo, analysisError);
|
| - expect(json, {
|
| - SEVERITY: 'ERROR',
|
| - TYPE: 'COMPILE_TIME_ERROR',
|
| - LOCATION: {
|
| - FILE: 'foo.dart',
|
| - OFFSET: 10,
|
| - LENGTH: 20,
|
| - START_LINE: 3,
|
| - START_COLUMN: 2
|
| - },
|
| - MESSAGE: 'my message'
|
| - });
|
| - }
|
| -
|
| - void test_noLineInfo() {
|
| - Map<String, Object> json = errorToJson(null, analysisError);
|
| - expect(json, {
|
| - SEVERITY: 'ERROR',
|
| - TYPE: 'COMPILE_TIME_ERROR',
|
| - LOCATION: {
|
| - FILE: 'foo.dart',
|
| - OFFSET: 10,
|
| - LENGTH: 20
|
| - },
|
| - MESSAGE: 'my message'
|
| - });
|
| - }
|
| -
|
| - void test_withCorrection() {
|
| - when(analysisError.correction).thenReturn('my correction');
|
| - Map<String, Object> json = errorToJson(lineInfo, analysisError);
|
| - expect(json, {
|
| - SEVERITY: 'ERROR',
|
| - TYPE: 'COMPILE_TIME_ERROR',
|
| - LOCATION: {
|
| - FILE: 'foo.dart',
|
| - OFFSET: 10,
|
| - LENGTH: 20,
|
| - START_LINE: 3,
|
| - START_COLUMN: 2
|
| - },
|
| - MESSAGE: 'my message',
|
| - CORRECTION: 'my correction'
|
| - });
|
| - }
|
| -}
|
|
|