Sorry for the long delay.  Lately I'm task-switching at a slow pace.  Also, I'm
quoting you out of order.

* Michael G Schwern <schw...@pobox.com> [2011-11-30T17:16:47]
> RJBS wrote,
> > The only case when the programmer needs to know about the Mouse
> > underpinnings is when hacking on the dist itself, not not ever reasonable
> > extensions?
> 
> Yes, unless you consider writing a Formatter and altering the behavior of the
> whole Test process to be "reasonable".

I feel like it's weird if Test::Builder v2 is delivered with the notice, "any
additional formatter classes must be made internal to Test-Builder, as they
must rely on a for-internal-use library.  Writing additional formatters is not
a reasonable extension."

That's what it sounds like, if you're saying that:

  a) TB2::Mouse is for internal use only
  b) nothing outside the dist should be using it
  c) it is unreasonable to write a new Formatter

I mean, if you are saying those things, okay!  I'm just surprised.

> TB2 will use Mouse if Mouse is available. [1]  Otherwise it will use
> TB2::Mouse, its bundled and namespace altered copy of Mouse::Tiny.  As far as
> any extensions are concerned, TB2 uses Mouse since must depend on Mouse.

This behavior worries me more than anything else.

"Everything" depends on Test::Builder.  I'm too lazy to do the legwork right
now, but I think we can agree that the vast majority of CPAN distributions with
tests use Test::Builder for their tests.  The opportunistic loading of Mouse
means that nearly *every dist* has the possibility to change its test-time
behavior based on an undeclared optional library.

[ extremely long, boring, elaborate example written then removed ]

I'm concerned about the action at a distance.  A change to Mouse can cause a
change in Test::Builder, if it really uses Mouse and not just a C&P of it.  If
a distribution at one point in someone's massive dependency tree starts
requiring Mouse, and is installed early, it could change the behavior of the
subsequently installed distributions, and the change will probably be
completely baffling to the user.

I am only a little bit comforted by "But the Mouse team will be testing TB2
before any release!"  The biggest reason is that they won't be testing every
extension to the Test::Builder framework that might be in play.  If writing
those extensions is unreasonable for anyone outside of the Test-Builder dist to
do, then maybe folks get what they deserve, but if that's the case, nobody
needs to write "use Mouse::Role" for a TB2 role, so the only reason to load
Mouse is to get Mouse::XS, which doesn't seem, to me and at first glance, like
the right trade-off.

If speed is the issue, and people know that their tests are too slow because of
the lack of Mouse XS, I wonder whether TB2_USE_MOUSE=1 isn't the answer.  Then
at least you're opting in to the risk.

-- 
rjbs

Reply via email to