[Templates-cvs] cvs commit: TT3/lib/Template Test.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
Fri, 03 Dec 2004 13:39:46 +0000
cvs 04/12/03 13:39:46
Modified: lib/Template Test.pm
Log:
* added 'step' option to step through tests one at a time, waiting for
user to press RETURN.
Revision Changes Path
1.9 +10 -10 TT3/lib/Template/Test.pm
Index: Test.pm
===================================================================
RCS file: /template-toolkit/TT3/lib/Template/Test.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- Test.pm 2004/12/01 17:59:59 1.8
+++ Test.pm 2004/12/03 13:39:45 1.9
@@ -16,7 +16,7 @@
# modify it under the same terms as Perl itself.
#
# REVISION
-# $Id: Test.pm,v 1.8 2004/12/01 17:59:59 abw Exp $
+# $Id: Test.pm,v 1.9 2004/12/03 13:39:45 abw Exp $
#
#========================================================================
@@ -28,7 +28,7 @@
use Template::Base;
use base qw( Template::Base Exporter );
-our $VERSION = sprintf("%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/);
+our $VERSION = sprintf("%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/);
our $DEBUG = 0 unless defined $DEBUG;
our $ERROR = '';
our $MAGIC = '\s* -- \s*';
@@ -222,6 +222,13 @@
next;
}
+ if ($config->{ step }) {
+ print STDERR "\n# ready to run: $test->{ name } (press ENTER)";
+ my $ans = <STDIN>;
+ chomp $ans;
+ exit if ($ans eq 'q');
+ };
+
my $result = &$handler($test);
chomp $result;
@@ -231,13 +238,6 @@
else {
# pass it over to is() to make pretty
is( $result, $test->{ expect }, $test->{ name });
-# ok(0, "$test->{ name } did not match");
-# my ($e, $r) = ($test->{ expect }, $result);
-# for ($e, $r) {
-# s/^/#/gm;
-# }
-# print STDERR "# -- expect --\n$e\n";
-# print STDERR "# -- result --\n$r\n";
if ($DIFF) {
print STDERR " diffs:\n";
diff_result($test->{ expect }, $result);
@@ -540,7 +540,7 @@
=head1 VERSION
-$Revision: 1.8 $
+$Revision: 1.9 $
=head1 COPYRIGHT