Skip to content

matchers: nicer syntax for Type testing #10407

@DartBot

Description

@DartBot

This issue was originally filed by @seaneagan


What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

currently it doesn't read as nicely as other matchers:

expect(x, new isInstanceOf<int>());
expect(f, throwsA(new isInstanceOf<ExpectedError>()));

better would be:

expect(x, isA(int));
expect(f, throwsA(isA(ExpectedError)));

or even:

expect(x, int);
expect(f, throwsA(ExpectedError));

I think this is blocked on issue #10406.

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.closed-duplicateClosed in favor of an existing report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions