Index: pkg/expect/lib/expect.dart |
diff --git a/sdk/lib/core/expect.dart b/pkg/expect/lib/expect.dart |
similarity index 97% |
copy from sdk/lib/core/expect.dart |
copy to pkg/expect/lib/expect.dart |
index 0302d3deef99c3d3309afb89374e0e9afc01ef27..0f83041aacca35c3c5efa67086e40600dbc5dee7 100644 |
--- a/sdk/lib/core/expect.dart |
+++ b/pkg/expect/lib/expect.dart |
@@ -2,23 +2,23 @@ |
// 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. |
-part of dart.core; |
+/** |
+ * This library contains an Expect class with static methods that can be used |
+ * for simple unit-tests. |
+ */ |
+library expect; |
/** |
- * This class is *deprecated*. |
- * |
* Expect is used for tests that do not want to make use of the |
* Dart unit test library - for example, the core language tests. |
* Third parties are discouraged from using this, and should use |
* the expect() function in the unit test library instead for |
* test assertions. |
*/ |
-@deprecated |
class Expect { |
/** |
* Checks whether the expected and actual values are equal (using `==`). |
*/ |
- @deprecated |
static void equals(var expected, var actual, [String reason = null]) { |
if (expected == actual) return; |
String msg = _getMessage(reason); |
@@ -28,7 +28,6 @@ class Expect { |
/** |
* Checks whether the actual value is a bool and its value is true. |
*/ |
- @deprecated |
static void isTrue(var actual, [String reason = null]) { |
if (_identical(actual, true)) return; |
String msg = _getMessage(reason); |
@@ -38,7 +37,6 @@ class Expect { |
/** |
* Checks whether the actual value is a bool and its value is false. |
*/ |
- @deprecated |
static void isFalse(var actual, [String reason = null]) { |
if (_identical(actual, false)) return; |
String msg = _getMessage(reason); |
@@ -48,7 +46,6 @@ class Expect { |
/** |
* Checks whether [actual] is null. |
*/ |
- @deprecated |
static void isNull(actual, [String reason = null]) { |
if (null == actual) return; |
String msg = _getMessage(reason); |
@@ -58,7 +55,6 @@ class Expect { |
/** |
* Checks whether [actual] is not null. |
*/ |
- @deprecated |
static void isNotNull(actual, [String reason = null]) { |
if (null != actual) return; |
String msg = _getMessage(reason); |
@@ -69,7 +65,6 @@ class Expect { |
* Checks whether the expected and actual values are identical |
* (using `identical`). |
*/ |
- @deprecated |
static void identical(var expected, var actual, [String reason = null]) { |
if (_identical(expected, actual)) return; |
String msg = _getMessage(reason); |
@@ -78,7 +73,6 @@ class Expect { |
} |
// Unconditional failure. |
- @deprecated |
static void fail(String msg) { |
_fail("Expect.fail('$msg')"); |
} |
@@ -88,7 +82,6 @@ class Expect { |
* given tolerance. If no tolerance is given, tolerance is assumed to be the |
* value 4 significant digits smaller than the value given for expected. |
*/ |
- @deprecated |
static void approxEquals(num expected, |
num actual, |
[num tolerance = null, |
@@ -104,7 +97,6 @@ class Expect { |
'tolerance:<$tolerance>$msg) fails'); |
} |
- @deprecated |
static void notEquals(unexpected, actual, [String reason = null]) { |
if (unexpected != actual) return; |
String msg = _getMessage(reason); |
@@ -118,7 +110,6 @@ class Expect { |
* used by the standard list implementation. It should also produce nicer |
* error messages than just calling `Expect.equals(expected, actual)`. |
*/ |
- @deprecated |
static void listEquals(List expected, List actual, [String reason = null]) { |
String msg = _getMessage(reason); |
int n = (expected.length < actual.length) ? expected.length : actual.length; |
@@ -143,7 +134,6 @@ class Expect { |
* the semantics of [Map.containsKey] to determine what "same" means. For |
* each key, checks that the values in both maps are equal using `==`. |
*/ |
- @deprecated |
static void mapEquals(Map expected, Map actual, [String reason = null]) { |
String msg = _getMessage(reason); |
@@ -168,7 +158,6 @@ class Expect { |
* Specialized equality test for strings. When the strings don't match, |
* this method shows where the mismatch starts and ends. |
*/ |
- @deprecated |
static void stringEquals(String expected, |
String actual, |
[String reason = null]) { |
@@ -237,7 +226,6 @@ class Expect { |
* Checks that every element of [expected] is also in [actual], and that |
* every element of [actual] is also in [expected]. |
*/ |
- @deprecated |
static void setEquals(Iterable expected, |
Iterable actual, |
[String reason = null]) { |
@@ -278,7 +266,6 @@ class Expect { |
* |
* Expect.throws(myThrowingFunction, (e) => e is MyException); |
*/ |
- @deprecated |
static void throws(void f(), |
[_CheckExceptionFn check = null, |
String reason = null]) { |
@@ -309,7 +296,6 @@ bool _identical(a, b) => identical(a, b); |
typedef bool _CheckExceptionFn(exception); |
-@deprecated |
class ExpectException implements Exception { |
ExpectException(this.message); |
String toString() => message; |