Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: matchers specifically for streams #8899

Closed
DartBot opened this issue Mar 4, 2013 · 14 comments
Closed

Request: matchers specifically for streams #8899

DartBot opened this issue Mar 4, 2013 · 14 comments
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Mar 4, 2013

This issue was originally filed by @sethladd


I'd love to see some matchers specifically for testing streams. The matchers package has a few matchers for handling Future (like completes).

@DartBot
Copy link
Author

DartBot commented Mar 4, 2013

This comment was originally written by @sethladd


File under Area=UnitTest

@lrhn
Copy link
Member

lrhn commented Mar 4, 2013

Removed Type-Defect label.
Added Type-Enhancement, Area-UnitTest, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Mar 4, 2013

This comment was originally written by @seaneagan


For starters could make most Iterable Matchers also work for Streams, since the API is so similar:

isEmpty
hasLength
contains
isIn
orderedEquals
unorderedEquals
someElement (rename to anyElement, since Iterable.some is now Iterable.any)
everyElement

@DartBot
Copy link
Author

DartBot commented Mar 4, 2013

This comment was originally written by @seaneagan


I think to help with implementing these sorts of Matchers, it would probably be useful if Matcher.matches were allowed to return a Future<bool> instead of just a bool.

@DartBot
Copy link
Author

DartBot commented Mar 4, 2013

This comment was originally written by @seaneagan


And actually it would probably work better as a rich MatchResult object instead of a plain bool, so it can store data about why it didn't match, to be used in "describe":

class Matcher {
  /// returns either [MatchResult] or [Future<MatchResult>] representing the match result
  match(object);
}

class MatchResult {
  final bool isMatch;
  Description describe(Description description, {bool verbose = false});
}
class Match extends MatchResult {...}
class Mismatch extends MatchResult {...}

@gramster
Copy link
Contributor

Regarding the mismatch state, we already have a mechanism for that (MatchState).

@DartBot
Copy link
Author

DartBot commented Apr 24, 2013

This comment was originally written by @seaneagan


returning Future<bool> from Matcher.matches is filed as issue #10188

@kevmoo
Copy link
Member

kevmoo commented Feb 12, 2014

Added Pkg-Unittest label.

@kevmoo
Copy link
Member

kevmoo commented Feb 12, 2014

Removed Area-UnitTest label.
Added Area-Pkg label.

@kevmoo
Copy link
Member

kevmoo commented May 9, 2014

Removed Pkg-Unittest label.
Added Pkg-matcher label.

@DartBot DartBot added Type-Enhancement area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. labels May 9, 2014
@sethladd
Copy link
Contributor

sethladd commented Jun 4, 2015

cc @kevmoo @nex3

Please close if this isn't planned.

@nex3
Copy link
Member

nex3 commented Jun 4, 2015

This is still planned, although it'll be in test rather than matcher.

@kevmoo
Copy link
Member

kevmoo commented Jun 5, 2015

This issue was moved to dart-lang/test#134

@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/matcher#13.

@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed triaged labels Mar 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants