Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: pkg/analysis_server/test/computer/error_test.dart

Issue 628293004: Remove references to Engine classes from protocol.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 test.computer.error; 5 library test.computer.error;
6 6
7 import 'package:analysis_server/src/constants.dart'; 7 import 'package:analysis_server/src/constants.dart';
8 import 'package:analysis_server/src/protocol.dart'; 8 import 'package:analysis_server/src/protocol_server.dart';
9 import 'package:analyzer/src/generated/error.dart' as engine; 9 import 'package:analyzer/src/generated/error.dart' as engine;
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
11 import 'package:typed_mock/typed_mock.dart'; 11 import 'package:typed_mock/typed_mock.dart';
12 import 'package:unittest/unittest.dart'; 12 import 'package:unittest/unittest.dart';
13 13
14 import '../mocks.dart'; 14 import '../mocks.dart';
15 import '../reflective_tests.dart'; 15 import '../reflective_tests.dart';
16 16
17 17
18 18
(...skipping 28 matching lines...) Expand all
47 when(engineError.length).thenReturn(20); 47 when(engineError.length).thenReturn(20);
48 } 48 }
49 49
50 void tearDown() { 50 void tearDown() {
51 source = null; 51 source = null;
52 engineError = null; 52 engineError = null;
53 } 53 }
54 54
55 void test_fromEngine_hasCorrection() { 55 void test_fromEngine_hasCorrection() {
56 when(engineError.correction).thenReturn('my correction'); 56 when(engineError.correction).thenReturn('my correction');
57 AnalysisError error = new AnalysisError.fromEngine(lineInfo, engineError); 57 AnalysisError error = newAnalysisError_fromEngine(lineInfo, engineError);
58 expect(error.toJson(), { 58 expect(error.toJson(), {
59 SEVERITY: 'ERROR', 59 SEVERITY: 'ERROR',
60 TYPE: 'COMPILE_TIME_ERROR', 60 TYPE: 'COMPILE_TIME_ERROR',
61 LOCATION: { 61 LOCATION: {
62 FILE: 'foo.dart', 62 FILE: 'foo.dart',
63 OFFSET: 10, 63 OFFSET: 10,
64 LENGTH: 20, 64 LENGTH: 20,
65 START_LINE: 3, 65 START_LINE: 3,
66 START_COLUMN: 2 66 START_COLUMN: 2
67 }, 67 },
68 MESSAGE: 'my message', 68 MESSAGE: 'my message',
69 CORRECTION: 'my correction' 69 CORRECTION: 'my correction'
70 }); 70 });
71 } 71 }
72 72
73 void test_fromEngine_noCorrection() { 73 void test_fromEngine_noCorrection() {
74 when(engineError.correction).thenReturn(null); 74 when(engineError.correction).thenReturn(null);
75 AnalysisError error = new AnalysisError.fromEngine(lineInfo, engineError); 75 AnalysisError error = newAnalysisError_fromEngine(lineInfo, engineError);
76 expect(error.toJson(), { 76 expect(error.toJson(), {
77 SEVERITY: 'ERROR', 77 SEVERITY: 'ERROR',
78 TYPE: 'COMPILE_TIME_ERROR', 78 TYPE: 'COMPILE_TIME_ERROR',
79 LOCATION: { 79 LOCATION: {
80 FILE: 'foo.dart', 80 FILE: 'foo.dart',
81 OFFSET: 10, 81 OFFSET: 10,
82 LENGTH: 20, 82 LENGTH: 20,
83 START_LINE: 3, 83 START_LINE: 3,
84 START_COLUMN: 2 84 START_COLUMN: 2
85 }, 85 },
86 MESSAGE: 'my message' 86 MESSAGE: 'my message'
87 }); 87 });
88 } 88 }
89 89
90 void test_fromEngine_noLineInfo() { 90 void test_fromEngine_noLineInfo() {
91 when(engineError.correction).thenReturn(null); 91 when(engineError.correction).thenReturn(null);
92 AnalysisError error = new AnalysisError.fromEngine(null, engineError); 92 AnalysisError error = newAnalysisError_fromEngine(null, engineError);
93 expect(error.toJson(), { 93 expect(error.toJson(), {
94 SEVERITY: 'ERROR', 94 SEVERITY: 'ERROR',
95 TYPE: 'COMPILE_TIME_ERROR', 95 TYPE: 'COMPILE_TIME_ERROR',
96 LOCATION: { 96 LOCATION: {
97 FILE: 'foo.dart', 97 FILE: 'foo.dart',
98 OFFSET: 10, 98 OFFSET: 10,
99 LENGTH: 20, 99 LENGTH: 20,
100 START_LINE: -1, 100 START_LINE: -1,
101 START_COLUMN: -1 101 START_COLUMN: -1
102 }, 102 },
103 MESSAGE: 'my message' 103 MESSAGE: 'my message'
104 }); 104 });
105 } 105 }
106 } 106 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/computer/element_test.dart ('k') | pkg/analysis_server/test/search/search_result_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698