jocarreira / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

ValueSet extension #9

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using hamcrest to describe constraints on stubs in parameterized tests.
 When solving these constraints, and describing why solving failed, it's
very useful to be able to generate an example value from a Matcher, and for
many Matchers, it's much easier to do inside the class than from the
outside.  Therefore, I've locally created a ValueSet interface, which
inherits from Matcher:

public interface ValueSet<T> extends Matcher<T> {
    public T exampleValue();
}

Is, IsEqual, and IsCollectionContaining are relatively easy to extend to
support this, as are many of the numeric Matchers.  Is this of general
enough use to be worth including as an option in the base hamcrest
distribution?

Original issue reported on code.google.com by david.s...@gmail.com on 31 Jan 2007 at 7:57

GoogleCodeExporter commented 8 years ago
I withdraw this request.  It's not part of core hamcrest

Original comment by david.s...@gmail.com on 9 May 2007 at 3:45

GoogleCodeExporter commented 8 years ago

Original comment by joe.wal...@gmail.com on 10 May 2007 at 9:17