IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 31, 2006, 12:58:34 PM (20 years ago)
Author:
jhoblitt
Message:

allow upper & lower case characters in DataStore fields
change from lower to upper case all fileset types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataStore/t/02_fileset_parse.t

    r7951 r8722  
    33# Copyright (C) 2006  Joshua Hoblitt
    44#
    5 # $Id: 02_fileset_parse.t,v 1.7 2006-07-22 01:17:34 smalle Exp $
     5# $Id: 02_fileset_parse.t,v 1.8 2006-08-31 22:58:34 jhoblitt Exp $
    66
    77use strict;
     
    6868    my $parser = DataStore::FileSet::Parser->new;
    6969
    70     is($parser->parse('|2006-01-01T00:03:04Z|object'), undef,
     70    is($parser->parse('|2006-01-01T00:03:04Z|OBJECT'), undef,
    7171        '->parse() returns undef on failure');
    7272} qr/does not conform /,
     
    7676    my $parser = DataStore::FileSet::Parser->new;
    7777
    78     is($parser->parse('foobar|2006-01-0100:03:04Z|object'), undef,
     78    is($parser->parse('foobar|2006-01-0100:03:04Z|OBJECT'), undef,
    7979        '->parse() returns undef on failure');
    8080} qr/does not conform /,
     
    109109my $example1 =<<END;
    110110# filesetID|time registered    |type   |telescope pointing         |etime|f|airmass|
    111 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    112 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    113 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    114 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     111otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     112otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     113otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     114otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    115115END
    116116    my $parser  = DataStore::FileSet::Parser->new(
     
    126126my $example1 =<<END;
    127127# filesetID|time registered    |type   |telescope pointing         |etime|f|airmass|
    128 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    129 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    130 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    131 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     128otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     129otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     130otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     131otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    132132END
    133133    my $parser  = DataStore::FileSet::Parser->new(
     
    142142    is(@$results[0]->fileset, 'otis0123456', 'correct fileset');
    143143    is(@$results[0]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    144     is(@$results[0]->type, 'object', 'correct type');
     144    is(@$results[0]->type, 'OBJECT', 'correct type');
    145145    is(@$results[0]->uri, 'http://foo.com/otis0123456/', 'correct uri');
    146146
     
    148148    is(@$results[1]->fileset, 'otis0123456', 'correct fileset');
    149149    is(@$results[1]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    150     is(@$results[1]->type, 'object', 'correct type');
     150    is(@$results[1]->type, 'OBJECT', 'correct type');
    151151    is(@$results[1]->uri, 'http://foo.com/otis0123456/', 'correct uri');
    152152
     
    154154    is(@$results[2]->fileset, 'otis0123456', 'correct fileset');
    155155    is(@$results[2]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    156     is(@$results[2]->type, 'object', 'correct type');
     156    is(@$results[2]->type, 'OBJECT', 'correct type');
    157157    is(@$results[2]->uri, 'http://foo.com/otis0123456/', 'correct uri');
    158158
     
    160160    is(@$results[3]->fileset, 'otis0123456', 'correct fileset');
    161161    is(@$results[3]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    162     is(@$results[3]->type, 'object', 'correct type');
     162    is(@$results[3]->type, 'OBJECT', 'correct type');
    163163    is(@$results[3]->uri, 'http://foo.com/otis0123456/', 'correct uri');
    164164}
     
    172172
    173173                            # random comment
    174 otis0123456|2006-01-01T00:03:04Z|object|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
     174otis0123456|2006-01-01T00:03:04Z|OBJECT|11:00:10.33 68:26:59.6 2000|30.0 |r|1.23   |
    175175
    176176                            # random comment
     
    185185    is(@$results[0]->fileset, 'otis0123456', 'correct fileset');
    186186    is(@$results[0]->datetime, '2006-01-01T00:03:04Z', 'correct datetime');
    187     is(@$results[0]->type, 'object', 'correct type');
     187    is(@$results[0]->type, 'OBJECT', 'correct type');
    188188}
Note: See TracChangeset for help on using the changeset viewer.