-
- # use slurp mode to read file content
- my $old_input_record_separator = $/;
- undef $/;
-
- while (my ($filename, $filedata) = each %{$self->{_downloads}}) {
- open (FILE, $filename)
- or return "Test failed: file $filename not downloaded";
-
- my $content = <FILE>;
- $content eq $filedata->{'content'}
- or return "Test failed: wrong content for file $filename";
-
- if (exists($filedata->{'timestamp'})) {
- my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
- $atime,$mtime,$ctime,$blksize,$blocks) = stat FILE;
-
- $mtime == $filedata->{'timestamp'}
- or return "Test failed: wrong timestamp for file $filename";
- }
-
- close (FILE);
- }
-
- $/ = $old_input_record_separator;
-
- return "";