stas 01/12/09 21:29:55
Modified: perl-framework/Apache-Test/lib/Apache TestUtil.pm
Log:
- cosmetic tweaks: separate args init from the code in subs
Revision Changes Path
1.19 +5 -1
httpd-test/perl-framework/Apache-Test/lib/Apache/TestUtil.pm
Index: TestUtil.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestUtil.pm,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- TestUtil.pm 2001/12/10 04:29:15 1.18
+++ TestUtil.pm 2001/12/10 05:29:55 1.19
@@ -41,6 +41,7 @@
sub t_write_file {
my $file = shift;
+
die "must pass a filename" unless defined $file;
my $fh = Symbol::gensym();
open $fh, ">$file" or die "can't open $file: $!";
@@ -52,6 +53,7 @@
sub t_open_file {
my $file = shift;
+
die "must pass a filename" unless defined $file;
my $fh = Symbol::gensym();
open $fh, ">$file" or die "can't open $file: $!";
@@ -83,9 +85,10 @@
sub t_mkdir {
my $dir = shift;
+
die "must pass a dirname" unless defined $dir;
- mkdir $dir, 0755 unless -d $dir;
t_debug("creating dir: $dir");
+ mkdir $dir, 0755 unless -d $dir;
$CLEAN{dirs}{$dir}++;
}
@@ -130,6 +133,7 @@
sub struct_as_string{
return "???" unless @_ == 2;
my $level = shift;
+
return "undef" unless defined $_[0];
my $pad = ' ' x (($level + 1) * INDENT);
my $spad = ' ' x ($level * INDENT);