I've become so spoiled by the swell convenience functions of Test::More that I missed them when I was throwing assertions in code. So, I started a module of 'em.
Down the road, Schwern has asked me to see if I can incorporate them and the rest of Carp::Assert into using Test::Builder, since they're so similar. My first thought is not a good one: Since Test::Builder uses a singleton, I'm not sure that a piece of code that both Carp::Assert and Test::More could co-exist in a single piece of code.
That's the Point! (Score:1)
Unless I'm tremendously misunderstanding your point, the Test::Builder singleton exists to make that possible. That's why we wrote it that way. As long as you can translate things into calls to Test::Builder::ok() somehow, it ought to work.
Re:That's the Point! (Score:1)
but then, I also want to test that, so in my .t file:
In this case, the singleton would be used by (in order) isa, assert_isa and ok. Test::Builder's
--
xoa
Re:That's the Point! (Score:1)
Oh, I think I understand. Writing tests for a module that uses Test::Builder can be tricky, yes. That's why there's Test::Builder::Tester [cpan.org].
Re:That's the Point! (Score:1)
If we made Carp::Assert use Test::Builder, then EVERY module that uses Carp::Assert (which I hope would be many) would suddenly become one of those tricky modules and people would have to use T::B::T. :-(
--
xoa