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

Unified Diff: pkg/unittest/lib/mock.dart

Issue 14153003: Remove deprecated <, <=, >, and >= of DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 | sdk/lib/core/date_time.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/unittest/lib/mock.dart
diff --git a/pkg/unittest/lib/mock.dart b/pkg/unittest/lib/mock.dart
index 730e4ff8a86a37240a5747411b50a410573df2b7..db243dbd545c4912ddea83e16e4262413cb64193 100644
--- a/pkg/unittest/lib/mock.dart
+++ b/pkg/unittest/lib/mock.dart
@@ -671,7 +671,7 @@ class LogEntryList {
* list is created.
*/
LogEntryList after(DateTime when, [bool inPlace = false]) =>
- _tail((e) => e.time > when, inPlace, 'after $when', logs.length);
+ _tail((e) => e.time.isAfter(when), inPlace, 'after $when', logs.length);
/**
* Returns log events that happened from [when] onwards. If
@@ -680,7 +680,7 @@ class LogEntryList {
* a new list is created.
*/
LogEntryList from(DateTime when, [bool inPlace = false]) =>
- _tail((e) => e.time >= when, inPlace, 'from $when', logs.length);
+ _tail((e) => !e.time.isBefore(when), inPlace, 'from $when', logs.length);
/**
* Returns log events that happened until [when]. If [inPlace]
@@ -689,7 +689,7 @@ class LogEntryList {
* list is created.
*/
LogEntryList until(DateTime when, [bool inPlace = false]) =>
- _head((e) => e.time > when, inPlace, 'until $when', logs.length);
+ _head((e) => e.time.isAfter(when), inPlace, 'until $when', logs.length);
/**
* Returns log events that happened before [when]. If [inPlace]
@@ -698,7 +698,10 @@ class LogEntryList {
* list is created.
*/
LogEntryList before(DateTime when, [bool inPlace = false]) =>
- _head((e) => e.time >= when, inPlace, 'before $when', logs.length);
+ _head((e) => !e.time.isBefore(when),
+ inPlace,
+ 'before $when',
+ logs.length);
/**
* Returns log events that happened after [logEntry]'s time.
« no previous file with comments | « no previous file | sdk/lib/core/date_time.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698