Dave's Unit Test 0.8.2 (Default branch)


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements Software Releases - RSS News Dave's Unit Test 0.8.2 (Default branch)
# 1  
Old 03-05-2008
Dave's Unit Test 0.8.2 (Default branch)

Dave's Unit Test (DUT) is a simple infrastructure for doing unit testing in C and C++. It can test boolean assertions, and test for the existence of expected C++ exceptions or POSIX signals. It also traps unexpected exceptions or signals. License: GNU General Public License v2 Changes:
This release adds warning-only versions of all test macros, has several minor dut.make bugfixes, and introduces some macros for the new test language based on the type to be tested rather than user supplied cache variables.Image

More...
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question
Test::Unit::Assertion::Regexp(3pm)			User Contributed Perl Documentation			Test::Unit::Assertion::Regexp(3pm)

NAME
Test::Unit::Assertion::Regexp - Assertion with regex matching SYNOPSIS
require Test::Unit::Assertion::Regexp; my $assert_re = Test::Unit::Assertion::Regexp->new(qr/a_pattern/); $assert_re->do_assertion('a_string'); This is rather more detail than the average user will need. Test::Unit::Assertion::Regexp objects are generated automagically by Test::Unit::Assert::assert when it is passed a regular expression as its first parameter. sub test_foo { ... $self->assert(qr/some_pattern/, $result); } If the assertion fails then the object throws an exception with details of the pattern and the string it failed to match against. Note that if you need to do a 'string does not match this pattern' type of assertion then you can do: $self->assert(qr/(?!some_pattern)/, $some_string) ie. Make use of the negative lookahead assertion. IMPLEMENTS
Test::Unit::Assertion::Regexp implements the Test::Unit::Assertion interface, which means it can be plugged into the Test::Unit::TestCase and friends' "assert" method with no ill effects. DESCRIPTION
The class is used by the framework to provide sensible 'automatic' reports when a match fails. The old: $self->assert(scalar($foo =~ /pattern/), "$foo didn't match /.../"); seems rather clumsy compared to this. If the regexp assertion fails, then the user is given a sensible error message, with the pattern and the string that failed to match it... AUTHOR
Copyright (c) 2001 Piers Cawley <pdcawley@iterative-software.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
o Test::Unit::TestCase o Test::Unit::Assertion perl v5.8.8 2006-09-13 Test::Unit::Assertion::Regexp(3pm)