[This is posted to both the perl-qa and the perlunit-devel lists]

Okay, I've just checked in a new branch of the Test::Unit CVS with
some fairy serious changes in place. Here's the CVS log entry.

---snip---
Beginnings of a major refactoring.

1. Replace Test::Unit::InnerClass with Class::Inner
2. Use Error.pm as the basis for exception handling and try/catch/...
   in place of eval.
3. Use Devel::Symdump in place of hand rolled symbol table manipulation.
4. Also includes an attempt at an 'assert_equals' that does the right
   thing in most cases. Tries to make reasonable guesses about numeric or
   string comparison, and can make use of object based equality things.
5. Started to port jUnit tests that make sense in the context of PerlUnit.

TODO: Need to get the procedural Test::Unit working. Or abandon it. However,
it does do some stuff that Test::More and friends don't (no plan testing
that actually produces a sensible 'test count')

Write more tests. (Patches welcome)
---snip---

I'm not entirely sure that all of this is necessary, but I think it
makes a good deal of sense to replace hand rolled stuff with packages
from CPAN where possible (admittedly Class::Inner got hand rolled by
me...), and it's *certainly* the case that Error.pm's 

try {
   ...
}
catch Test::Unit::ExcpetionFailure with {
   ...
}
otherwise {
   # soak up the error
}
finally {
   ...
}

is clearer than the eval stuff we've been doing.

I'm also toying with renaming a couple of classes --
Test::Unit::ExceptionFailure could almost certainly become
Test::Unit::Failure without and loss of clarity, but I'm also
seriously wondering about making the 'behind the scenes' classes (the
Assertion tree and the Exceptions) become:

T::U::Exception
T::U::Failure
T::U::Error
T::U::Assertion
T::U::Assertion::*

but this may just be excessive laziness on my part.

I've also been thinking about test 'metadata', ie skiplists and the
like, and a little light went on:

sub test_something : todo {...}
sub test_something : skip_if(<condition>) {...}
sub test_something : skip {...}

TestRunners can take (or not take) notice of this information. Time to
investigate Attribute::Handlers methinks. But first I'll get
Test::Unit working again.

Wanted:

More tests.
More examples.
Ports of the jUnit test suite (those parts that make sense).
Reports from Devel::Cover.
More/better documentation -- someone's just posted a tutorial in Word
format to one of the xp sites.
More reference sites...

-- 
Piers Cawley
www.iterative-software.com

Reply via email to