Unverified Commit 37c95a28 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub

fix: `moreOrLessEquals` does not allow `actual` to be integers (#125599)

Close https://github.com/flutter/flutter/issues/125600
parent b359f110
......@@ -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) {
......
......@@ -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', () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment