What are the best std algo for testing a range implementation ?

monarch_dodra via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 27 07:05:55 PDT 2014


On Tuesday, 27 May 2014 at 12:18:15 UTC, BicMedium wrote:
> I mean that those tests are just like testing an interface...).

If your interface isn't complete, than it is irrelevant what your 
implementations are, since the algorithms can't use your ranges 
anyways.

> BTW the 2nd and the 3rd assertions are exactly what fails when 
> I try to test an algo (isInputRange!Range or 
> isOutputRange!Range pass but has the test doesn't know about 
> the implementation I can't know If it's really working...

Probably you are missing `save`, or you implemented it as a 
non-property function (though arguably, it shouldn't be a 
property, but that's another issue).


More information about the Digitalmars-d-learn mailing list