File: gsd.t

package info (click to toggle)
libastro-fits-header-perl 3.01-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 356 kB
  • ctags: 81
  • sloc: perl: 2,265; makefile: 21
file content (34 lines) | stat: -rw-r--r-- 678 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!perl
# Testing GSD read of fits headers

use strict;

use Test::More;

BEGIN {
  eval "use GSD;";
  if ($@) {
    plan skip_all => "GSD module not available";
    exit;
  } else {
    plan tests => 4;
  }
}

use File::Spec;
require_ok( "Astro::FITS::Header::GSD" );

# Read-only
# Try to work out whether the file is in the t directory or the parent
my $gsdfile = "test.gsd";

$gsdfile = File::Spec->catfile("t","test.gsd")
  unless -e $gsdfile;

my $hdr = new Astro::FITS::Header::GSD( File => $gsdfile );
ok( $hdr );

# Get the telescope name
my $item = $hdr->itembyname( 'C1TEL' );
is( $item->value, "JCMT", "Check C1TEL");
is( $item->type, "STRING", "Check C1TEL type" );