use strict;
use vars qw($VERSION $CLASS);
-$VERSION = '0.11';
+$VERSION = '0.12';
$CLASS = __PACKAGE__;
my $IsVMS = $^O eq 'VMS';
if( defined $num ) {
$Curr_Test = $num;
+ if( $num > @Test_Results ) {
+ for ($#Test_Results..$num-1) {
+ $Test_Results[$_] = 1;
+ }
+ }
}
return $Curr_Test;
}
require Exporter;
use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO);
-$VERSION = '0.41';
+$VERSION = '0.42';
@ISA = qw(Exporter);
@EXPORT = qw(ok use_ok require_ok
is isnt like unlike is_deeply
=head2 Test names
By convention, each test is assigned a number in order. This is
-largely done automatically for you. However, its often very useful to
+largely done automatically for you. However, it's often very useful to
assign a name to each test. Which would you rather see:
ok 4
to find the test in your script, simply search for "simple
exponential".
-All test functions take a name argument. Its optional, but highly
+All test functions take a name argument. It's optional, but highly
suggested that you use it.
# &&
# undef
-Its also useful in those cases where you are comparing numbers and
+It's also useful in those cases where you are comparing numbers and
is()'s use of C<eq> will interfere:
cmp_ok( $big_hairy_number, '==', $another_big_hairy_number );
}
my $name;
- $name = @methods == 1 ? "$class->can($methods[0])"
+ $name = @methods == 1 ? "$class->can('$methods[0]')"
: "$class->can(...)";
my $ok = $Test->ok( !@nok, $name );
if( $@ =~ /^Can't call method "isa" on unblessed reference/ ) {
if( !UNIVERSAL::isa($object, $class) ) {
my $ref = ref $object;
- $diag = "$obj_name isn't a '$class' its a '$ref'";
+ $diag = "$obj_name isn't a '$class' it's a '$ref'";
}
} else {
die <<WHOA;
}
elsif( !$rslt ) {
my $ref = ref $object;
- $diag = "$obj_name isn't a '$class' its a '$ref'";
+ $diag = "$obj_name isn't a '$class' it's a '$ref'";
}
}
use strict 'vars';
use vars qw($VERSION);
-$VERSION = '0.41';
+$VERSION = '0.42';
use Test::Builder;
Revision history for Perl extension Test::Simple
+0.42 Wed Mar 6 15:00:24 EST 2002
+ - Setting Test::Builder->current_test() now works (see what happens
+ when you forget to test things?)
+ - The change in is()'s undef/'' handling in 0.34 was an API change,
+ but I forgot to declare it as such.
+ - The apostrophilic jihad attacks! Philip Newtons patch for
+ grammar mistakes in the doc's.
+
0.41 Mon Dec 17 22:45:20 EST 2001
* chromatic added diag()
- Internal eval()'s sometimes interfering with $@ and $!. Fixed.
- Little glitch in the test suite. No actual bug.
0.34 Tue Nov 27 15:43:56 EST 2001
- * Empty string no longer matches undef in is() and isnt().
+ * **API CHANGE** Empty string no longer matches undef in is()
+ and isnt().
* Added isnt_eq and isnt_num to Test::Builder.
0.33 Mon Oct 22 21:05:47 EDT 2001
use Test::Builder;
my $Test = Test::Builder->new;
-$Test->plan( tests => 4 );
+$Test->plan( tests => 7 );
my $default_lvl = $Test->level;
$Test->level(0);
$Test->is_eq('foo', 'foo', 'is_eq');
$Test->is_num('23.0', '23', 'is_num');
+$Test->is_num( $Test->current_test, 4, 'current_test() get' );
+
+my $test_num = $Test->current_test + 1;
+$Test->current_test( $test_num );
+print "ok $test_num - current_test() set\n";
+
+$Test->ok( 1, 'counter still good' );
# Failed test ($0 at line 53)
# can_ok() called with no methods
# Failed test ($0 at line 55)
-# The object isn't a 'Wibble' its a 'Foo'
+# The object isn't a 'Wibble' it's a 'Foo'
# Failed test ($0 at line 56)
# My Wibble isn't a reference
# Failed test ($0 at line 57)
# Another Wibble isn't defined
# Failed test ($0 at line 58)
-# The object isn't a 'HASH' its a 'ARRAY'
+# The object isn't a 'HASH' it's a 'ARRAY'
# Failed test ($0 at line 68)
# got: 'foo'
# expected: 'bar'