Skip to content

Commit

Permalink
Add wfits test showing failure with mulit-line HISTORY hdr field
Browse files Browse the repository at this point in the history
This adds one passing and one (currently) failing test with
multi-line HISTORY strings in the header.
  • Loading branch information
d-lamb committed Aug 7, 2024
1 parent 9ec2992 commit e744c78
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions IO/FITS/t/fits.t
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,25 @@ ok all(approx $m51, $m51_2), 'read back written-out compressed FITS file' or dia
unlink $fname if -e $fname;
}

#multi-line HISTORY header writing
{ my $f_out;
my $hstr = join("\n",'A'..'G');

$f_out = 'long_history.fits';
my $x = xvals(10);
$x->hdr->{'HISTORY'} = $hstr;
$x->wfits($f_out);
my $xr = rfits($f_out);
is($xr->hdr->{'HISTORY'}, $hstr, 'multi-line HISTORY correct with fresh header');
unlink($f_out) or die "couldn't delete $f_out";

$f_out = 'm51_longhist.fits';
my $m51 = rfits('t/m51.fits.fz');
$m51->hdr->{HISTORY} = $hstr;
$m51->wfits($f_out);
my $m51r = rfits($f_out);
is($m51r->hdr->{'HISTORY'}, $hstr, 'multi-line HISTORY correct with pre-existing header');
unlink($f_out) or die "couldn't delete $f_out";
}

done_testing();

0 comments on commit e744c78

Please sign in to comment.