Code Monkey home page Code Monkey logo

Comments (13)

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd


File under Area=UnitTest

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/4865287?v=3" align="left" width="48" height="48"hspace="10"> Comment by lrhn


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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment 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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment 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.

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment 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 {...}

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/2762632?v=3" align="left" width="48" height="48"hspace="10"> Comment by gramster


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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/444270?v=3" align="left" width="48" height="48"hspace="10"> Comment by seaneagan


returning Future<bool> from Matcher.matches is filed as issue dart-lang/test#211

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


Added Pkg-Unittest label.

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd


cc @kevmoo @nex3

Please close if this isn't planned.

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


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

from matcher.

DartBot avatar DartBot commented on August 24, 2024

<img src="https://avatars.githubusercontent.com/u/17034?v=3" align="left" width="48" height="48"hspace="10"> Comment by kevmoo


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

from matcher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.