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

Unified Diff: dart/frog/leg/lib/core.dart

Issue 9404015: Use Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 10 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
« no previous file with comments | « no previous file | dart/frog/leg/lib/js_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/frog/leg/lib/core.dart
diff --git a/dart/frog/leg/lib/core.dart b/dart/frog/leg/lib/core.dart
index cd64f9659c0fe7ecf905f6f92eca3075419c6be3..7e837b5638b4023fdcab22d54619bb24fe2060ed 100644
--- a/dart/frog/leg/lib/core.dart
+++ b/dart/frog/leg/lib/core.dart
@@ -15,7 +15,7 @@
#source('../../../corelib/src/double.dart');
#source('../../../corelib/src/duration.dart');
// #source('../../../corelib/src/exceptions.dart');
-// #source('../../../corelib/src/expect.dart');
+#source('../../../corelib/src/expect.dart');
#source('../../../corelib/src/function.dart');
#source('../../../corelib/src/future.dart');
#source('../../../corelib/src/hashable.dart');
@@ -64,46 +64,7 @@ class List<T> implements Iterable<T> {
factory List([int length]) => Primitives.newList(length);
}
-class Expect {
- // TODO(ngeoffray): add optional message parameters to these
- // methods.
- static void equals(var expected, var actual) {
- if (expected == actual) return;
- _fail('Expect.equals(expected: <$expected>, actual:<$actual> fails.');
- }
-
- static void fail(String message) {
- _fail("Expect.fail('$message')");
- }
-
- static void _fail(String message) {
- throw message;
- }
-
- static void isTrue(var actual) {
- if (actual === true) return;
- _fail("Expect.isTrue($actual) fails.");
- }
-
- static void isFalse(var actual) {
- if (actual === false) return;
- _fail("Expect.isFalse($actual) fails.");
- }
-
- static void listEquals(List expected, List actual) {
- // We check on length at the end in order to provide better error
- // messages when an unexpected item is inserted in a list.
- if (expected.length != actual.length) {
- _fail('list not equals');
- }
-
- for (int i = 0; i < expected.length; i++) {
- if (expected[i] != actual[i]) {
- _fail('list not equals');
- }
- }
- }
-}
+interface Exception {}
class Stopwatch {
double startMs;
« no previous file with comments | « no previous file | dart/frog/leg/lib/js_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698