Thread overview
[Issue 14082] RedBlackTree unittest fails with custom predicate less
Jan 30, 2015
drug007
Jan 30, 2015
drug007
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schveiguy@yahoo.com
           Assignee|nobody@puremagic.com        |schveiguy@yahoo.com

--- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> ---
The real answer is that phobos unit tests should not run when you run your private unit tests. That is really a language change that needs to happen.

The band-aid answer is that the unit tests should ONLY run if we know exactly the instantiating parameters are. When I wrote those, I didn't consider that I should worry about the less parameter.

--
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #2 from drug007 <drug2004@bk.ru> ---
I agree. Also I'm curious why RedBlackTree instance in Phobos unittest get less from my private unittest?

--
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #3 from Steven Schveighoffer <schveiguy@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.

--
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #4 from drug007 <drug2004@bk.ru> ---
I see. Thanks for clarification!

--
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #5 from Steven Schveighoffer <schveiguy@yahoo.com> ---
PR: https://github.com/D-Programming-Language/phobos/pull/2936

--
January 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/acac6266085454224b144316b088f62fc96d95b5 Fix issue 14082 -- unit test should only test known cases in red black tree.

https://github.com/D-Programming-Language/phobos/commit/a4bd3dff631372062d192a7295eff3401098b7f5 Merge pull request #2936 from schveiguy/issue14082

Fix issue 14082 -- RedBlackTree unittest fails with custom predicate less

--
February 19, 2015
https://issues.dlang.org/show_bug.cgi?id=14082

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to 2.067 at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/acac6266085454224b144316b088f62fc96d95b5 Fix issue 14082 -- unit test should only test known cases in red black tree.

https://github.com/D-Programming-Language/phobos/commit/a4bd3dff631372062d192a7295eff3401098b7f5 Merge pull request #2936 from schveiguy/issue14082

--