Comments (13)
<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.
<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.
<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.
<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.
<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.
<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.
<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.
<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.
<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.
<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.
<img src="https://avatars.githubusercontent.com/u/5479?v=3" align="left" width="48" height="48"hspace="10"> Comment by sethladd
Please close if this isn't planned.
from matcher.
<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.
<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)
- Implement describeMismatch for TypeMatcher HOT 2
- orderedEquals fails for identical lists of maps<String, dynamic> HOT 4
- ContainsKey matcher for Maps HOT 2
- _DeepMatcher crash on badly behaved Iterable HOT 1
- Add a best practices section in the readme HOT 1
- Add a matcher with custom selector HOT 1
- AllOf() matcher crashes if inner matchers throw HOT 1
- Consider publishing a 1.0.0 release HOT 2
- Prepare for Dart 3 HOT 6
- revert to min sdk 2.12 HOT 11
- analysis failures on the CI
- Make whitespace comparison better.
- Add matchers for testing the stacktrace when an object is thrown
- Change test function to detect when it is called with a Matcher Function() instead of a Matcher HOT 3
- Can we make `_DeepMatcher` handle records? HOT 4
- Add a delegating matcher
- `expect` functions should be typed HOT 5
- Difference between yield and yield* in emitsInOrder
- Add `throwsTypeError` to `throws_matchers.dart`
- FR: Possible to customise the equals() matcher to use closeTo()
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matcher.