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

Side by Side Diff: pkg/analysis_testing/lib/mock_sdk.dart

Issue 437323004: Port and test more assists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix for review comment. Created 6 years, 4 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
« no previous file with comments | « pkg/analysis_services/test/search/hierarchy_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 testing.mock_sdk; 5 library testing.mock_sdk;
6 6
7 import 'package:analyzer/file_system/file_system.dart' as resource; 7 import 'package:analyzer/file_system/file_system.dart' as resource;
8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource;
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/sdk.dart'; 10 import 'package:analyzer/src/generated/sdk.dart';
11 import 'package:analyzer/src/generated/source.dart'; 11 import 'package:analyzer/src/generated/source.dart';
12 12
13 13
14 class MockSdk implements DartSdk { 14 class MockSdk implements DartSdk {
15 final resource.MemoryResourceProvider provider = 15 final resource.MemoryResourceProvider provider =
16 new resource.MemoryResourceProvider(); 16 new resource.MemoryResourceProvider();
17 17
18 static const _MockSdkLibrary LIB_CORE = 18 static const _MockSdkLibrary LIB_CORE =
19 const _MockSdkLibrary('dart:core', '/lib/core/core.dart', ''' 19 const _MockSdkLibrary('dart:core', '/lib/core/core.dart', '''
20 library dart.core; 20 library dart.core;
21 class Object {} 21
22 class Object {
23 bool operator ==(other) => identical(this, other);
24 }
25
22 class Function {} 26 class Function {}
23 class StackTrace {} 27 class StackTrace {}
24 class Symbol {} 28 class Symbol {}
25 class Type {} 29 class Type {}
26 30
27 abstract class Comparable<T> { 31 abstract class Comparable<T> {
28 int compareTo(T other); 32 int compareTo(T other);
29 } 33 }
30 34
31 class String implements Comparable<String> { 35 class String implements Comparable<String> {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 77 }
74 78
75 class Stream<T> {} 79 class Stream<T> {}
76 '''); 80 ''');
77 81
78 static const _MockSdkLibrary LIB_MATH = 82 static const _MockSdkLibrary LIB_MATH =
79 const _MockSdkLibrary('dart:math', '/lib/math/math.dart', ''' 83 const _MockSdkLibrary('dart:math', '/lib/math/math.dart', '''
80 library dart.math; 84 library dart.math;
81 const double E = 2.718281828459045; 85 const double E = 2.718281828459045;
82 const double PI = 3.1415926535897932; 86 const double PI = 3.1415926535897932;
87 num min(num a, num b) => 0;
88 num max(num a, num b) => 0;
83 '''); 89 ''');
84 90
85 static const _MockSdkLibrary LIB_HTML = 91 static const _MockSdkLibrary LIB_HTML =
86 const _MockSdkLibrary('dart:html', '/lib/html/dartium/html_dartium.dart', ''' 92 const _MockSdkLibrary('dart:html', '/lib/html/dartium/html_dartium.dart', '''
87 library dart.html; 93 library dart.html;
88 class HtmlElement {} 94 class HtmlElement {}
89 '''); 95 ''');
90 96
91 static const List<SdkLibrary> LIBRARIES = const [ 97 static const List<SdkLibrary> LIBRARIES = const [
92 LIB_CORE, 98 LIB_CORE,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 bool get isInternal => throw unimplemented; 186 bool get isInternal => throw unimplemented;
181 187
182 @override 188 @override
183 bool get isShared => throw unimplemented; 189 bool get isShared => throw unimplemented;
184 190
185 @override 191 @override
186 bool get isVmLibrary => throw unimplemented; 192 bool get isVmLibrary => throw unimplemented;
187 193
188 UnimplementedError get unimplemented => new UnimplementedError(); 194 UnimplementedError get unimplemented => new UnimplementedError();
189 } 195 }
OLDNEW
« no previous file with comments | « pkg/analysis_services/test/search/hierarchy_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698