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

Unified Diff: pkg/analysis_server/test/mock_sdk.dart

Issue 2650803005: Make Analysis Server tests use MockSdk again. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/mock_sdk.dart
diff --git a/pkg/analysis_server/test/mock_sdk.dart b/pkg/analysis_server/test/mock_sdk.dart
index b188e7574462df8511287064d18c5ccc0e9d7ae7..9027e6d05e6b5d9045cbc842e193b92e8208a6e0 100644
--- a/pkg/analysis_server/test/mock_sdk.dart
+++ b/pkg/analysis_server/test/mock_sdk.dart
@@ -24,9 +24,12 @@ import 'dart:async';
import 'dart:_internal';
class Object {
+ const Object() {}
bool operator ==(other) => identical(this, other);
String toString() => 'a string';
int get hashCode => 0;
+ Type get runtimeType => null;
+ dynamic noSuchMethod(Invocation invocation) => null;
}
class Function {}
@@ -130,13 +133,24 @@ abstract class Iterable<E> {
Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e));
}
-abstract class List<E> implements Iterable<E> {
- void add(E value);
+class List<E> implements Iterable<E> {
+ List();
+ void add(E value) {}
void addAll(Iterable<E> iterable) {}
- E operator [](int index);
- void operator []=(int index, E value);
+ E operator [](int index) => null;
+ void operator []=(int index, E value) {}
Iterator<E> get iterator => null;
- void clear();
+ void clear() {}
+
+ bool get isEmpty => false;
+ E get first => null;
+ E get last => null;
+
+ Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e)) => null;
+
+ /*=R*/ fold/*<R>*/(/*=R*/ initialValue,
+ /*=R*/ combine(/*=R*/ previousValue, E element)) => null;
+
}
abstract class Map<K, V> extends Object {
@@ -208,8 +222,8 @@ library dart.math;
const double E = 2.718281828459045;
const double PI = 3.1415926535897932;
const double LN10 = 2.302585092994046;
-num min(num a, num b) => 0;
-num max(num a, num b) => 0;
+T min<T extends num>(T a, T b) => null;
+T max<T extends num>(T a, T b) => null;
external double cos(num x);
external num pow(num x, num exponent);
external double sin(num x);
« no previous file with comments | « pkg/analysis_server/test/abstract_context.dart ('k') | pkg/analysis_server/test/services/completion/dart/optype_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698