Skip to content

moreOrLessEquals does not allow actual to be integers #125600

@fzyzcjy

Description

@fzyzcjy

Is there an existing issue for this?

Steps to reproduce

import 'package:flutter_test/flutter_test.dart';

void main() {
  test('when actual is int', () {
    expect(100, moreOrLessEquals(100));
  });

  test('when actual is double', () {
    expect(100.0, moreOrLessEquals(100));
  });
}

Expected results

no err

Actual results

the "when actual is int" errors:

package:test_api                                    expect
package:flutter_test/src/widget_tester.dart 460:16  expect
test/a.dart 5:5                                     main.<fn>

Expected: 100.0 (±1e-10)
  Actual: <100>
   Which: 100 is not in the range of 100.0 (±1e-10).

Code sample

Code sample
see above

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
unrelated

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsfound in release: 3.10Found to occur in 3.10found in release: 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions