[Issue 14082] RedBlackTree unittest fails with custom predicate less
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jan 30 06:49:49 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14082
--- Comment #3 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to drug007 from comment #2)
> I agree. Also I'm curious why RedBlackTree instance in Phobos unittest get
> less from my private unittest?
RedBlackTree unit tests are done inside the class, so every instantiation of
RBT creates its own set of unit tests. It's actually quite useful, I found
about 3 compiler bugs because of it.
But the drawback is that EVERY instantiation of RBT creates its own unit tests.
And it's nearly impossible to make a unit test that works for every
instantation.
So I have code that limits when unit tests run, based on the *type* of the data
stored. But I never thought of limiting it based on the lambda. I just have to
add a few static ifs, and you will be all set.
--
More information about the Digitalmars-d-bugs
mailing list