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

Matcher: extend a Predicate interface #3722

Closed
DartBot opened this issue Jun 18, 2012 · 8 comments
Closed

Matcher: extend a Predicate interface #3722

DartBot opened this issue Jun 18, 2012 · 8 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 Jun 18, 2012

This issue was originally filed by @seaneagan


If we had:

typedef bool Predicate<T>(T item);
interface Matcher<T> extends Predicate<T> {...}

instead of Matcher#matches, thus using "operator call", then the following would work:

collection.some(same(value));
collection.every(isNotNull);
collection.filter(isPositive);

Also, issue #2949 could be solved with:

switch(x) {
  match (isNegative) ...
  case (0) ...
  match (lessThan(5)) ...
  // avoid full blown Matcher since don't need mismatch messages
  match ((i) => i.isEven()) ...
  default ...
}

@anders-sandholm
Copy link
Contributor

Added Area-UnitTest, Triaged labels.

@gramster
Copy link
Contributor

Set owner to @gramster.

@gramster
Copy link
Contributor

Removed the owner.

@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 Mar 24, 2014

Love the idea!


Removed Type-Defect label.
Added Type-Enhancement, PatchesWelcome labels.

@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
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

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

@DartBot DartBot closed this as completed Jun 5, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement 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

4 participants