Skip to content

Commit

Permalink
fix: moreOrLessEquals does not allow actual to be integers (#125599)
Browse files Browse the repository at this point in the history
Close #125600
  • Loading branch information
fzyzcjy committed Apr 27, 2023
1 parent b359f11 commit 37c95a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flutter_test/lib/src/matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1444,7 +1444,7 @@ class _MoreOrLessEquals extends Matcher {

@override
bool matches(dynamic object, Map<dynamic, dynamic> matchState) {
if (object is! double) {
if (object is! num) {
return false;
}
if (object == value) {
Expand Down
3 changes: 3 additions & 0 deletions packages/flutter_test/test/matchers_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ void main() {

expect(11.0, moreOrLessEquals(-11.0, epsilon: 100.0));
expect(-11.0, moreOrLessEquals(11.0, epsilon: 100.0));

expect(0, moreOrLessEquals(0.0));
expect(0.0, moreOrLessEquals(0));
});

test('matrixMoreOrLessEquals', () {
Expand Down

0 comments on commit 37c95a2

Please sign in to comment.