1 #============================================================= -*-Perl-*-
6 # Module implementing some useful subroutines for testing.
9 # Andy Wardley <abw@kfs.org>
12 # Copyright (C) 2000, 2001 Andy Wardley. All Rights Reserved.
14 # This module is free software; you can redistribute it and/or
15 # modify it under the same terms as Perl itself.
18 # $Id: Test.pm 14 2009-03-13 08:19:40Z ford $
20 #========================================================================
22 package BASIS::Pod::POM::Test;
28 use base qw( Exporter );
29 use vars qw( $VERSION @EXPORT );
31 $VERSION = sprintf("%d.%02d", q$Revision: 1.1.1.1 $ =~ /(\d+)\.(\d+)/);
32 @EXPORT = qw( ntests ok match assert );
45 print "ok ", $ok_count++, "\n";
48 print "FAILED $ok_count: $msg\n" if defined $msg;
49 print "not ok ", $ok_count++, "\n";
58 my ($pkg, $file, $line) = caller();
59 $err ||= "assert failed";
60 $err .= " at $file line $line\n";
67 my ($result, $expect) = @_;
69 # force stringification of $result to avoid 'no eq method' overload errors
70 $result = "$result" if ref $result;
72 if ($result eq $expect) {
76 print "FAILED $ok_count:\n expect: [$expect]\n result: [$result]\n";