Skip to content

Commit

Permalink
test(time_of_day_extension): provide TimeOfDayExtension.compare com…
Browse files Browse the repository at this point in the history
…parator
  • Loading branch information
albertms10 committed Dec 19, 2021
1 parent b9e3ea2 commit f10b65f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions test/time_of_day_extension_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,13 @@ void main() {

// TODO(albertms10): remove when implemented in Flutter, https://github.com/flutter/flutter/pull/59981
group('Comparable<TimeOfDay>', () {
test('.compare', () {
expect(
TimeOfDayExtension.compare(
const TimeOfDay(hour: 0, minute: 0),
const TimeOfDay(hour: 0, minute: 0),
),
0,
);
});

test('.compareTo', () {
expect(
[
const TimeOfDay(hour: 12, minute: 0),
const TimeOfDay(hour: 23, minute: 59),
const TimeOfDay(hour: 0, minute: 0),
]..sort(),
]..sort(TimeOfDayExtension.compare),
[
const TimeOfDay(hour: 0, minute: 0),
const TimeOfDay(hour: 12, minute: 0),
Expand All @@ -134,7 +124,7 @@ void main() {
const TimeOfDay(hour: 0, minute: 0),
const TimeOfDay(hour: 23, minute: 59),
const TimeOfDay(hour: 12, minute: 0),
]..sort(),
]..sort(TimeOfDayExtension.compare),
[
const TimeOfDay(hour: 0, minute: 0),
const TimeOfDay(hour: 12, minute: 0),
Expand Down

0 comments on commit f10b65f

Please sign in to comment.