Skip to content

matchers: nicer syntax for Type testing #214

Closed
@DartBot

Description

@DartBot

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="96" height="96"hspace="10"> Issue by seaneagan
Originally opened as dart-lang/sdk#10407


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 dart-lang/sdk#10406.

Please provide any additional information below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed-duplicateClosed in favor of an existing reporttype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions