IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 24, 2005, 12:32:55 PM (21 years ago)
Author:
jhoblitt
Message:

add MULTI METADATA and MULTI TYPE tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Metadata-Config/t/06_multi.t

    r3494 r3496  
    33# Copyright (C) 2005  Joshua Hoblitt
    44#
    5 # $Id: 06_multi.t,v 1.4 2005-03-24 22:07:25 jhoblitt Exp $
     5# $Id: 06_multi.t,v 1.5 2005-03-24 22:32:55 jhoblitt Exp $
    66
    77use strict;
     
    1212#$::RD_TRACE = 1;
    1313
    14 use Test::More tests => 8;
     14use Test::More tests => 13;
    1515use PS::IPP::Metadata::Config;
    1616
     
    5959my $example = q{
    6060foo MULTI
     61foo METADATA
     62    bar BOOL    T
     63END
     64foo METADATA
     65    bar BOOL    T
     66END
     67};
     68    my $config = $config_parser->parse( $example );
     69    ok( defined( $config ), "MULTI METADATA");
     70}
     71
     72{
     73my $example = q{
     74foo METADATA
     75    bar BOOL    T
     76END
     77foo METADATA
     78    bar BOOL    T
     79END
     80};
     81    my $config = $config_parser->parse( $example );
     82
     83    my $tree = [
     84        {
     85            name    => 'foo',
     86            class   => 'metadata',
     87            value   => [{
     88                            name    => 'bar',
     89                            class   => 'scalar',
     90                            type    => 'BOOL',
     91                            value   => 1,
     92                        }],
     93        },
     94    ];
     95
     96    is_deeply( $config, $tree, "MULTI METADATA structure, not declared" );
     97}
     98
     99{
     100my $example = q{
     101foo MULTI
     102TYPE bar a b c
     103foo  bar x y z
     104foo  bar x y z
     105};
     106    my $config = $config_parser->parse( $example );
     107    ok( defined( $config ), "MULTI TYPE");
     108}
     109
     110{
     111my $example = q{
     112TYPE bar a b c
     113foo MULTI
     114foo  bar x y z
     115foo  bar x y z
     116};
     117    my $config = $config_parser->parse( $example );
     118
     119    ok( defined( $config ), "MULTI TYPE");
     120}
     121
     122{
     123my $example = q{
     124TYPE bar a b c
     125foo  bar x y z
     126foo  bar x y z
     127};
     128    my $config = $config_parser->parse( $example );
     129
     130    my $tree = [
     131        {
     132            name    => 'foo',
     133            class   => 'metadata',
     134            value   => [
     135                {
     136                    name    => 'a',
     137                    class   => 'scalar',
     138                    type    => 'STR',
     139                    value   => 'x',
     140                },
     141                {
     142                    name    => 'b',
     143                    class   => 'scalar',
     144                    type    => 'STR',
     145                    value   => 'y',
     146                },
     147                {
     148                    name    => 'c',
     149                    class   => 'scalar',
     150                    type    => 'STR',
     151                    value   => 'z',
     152                },
     153            ],
     154        },
     155    ];
     156
     157    is_deeply( $config, $tree, "MULTI TYPE structure, not declared" );
     158}
     159
     160{
     161my $example = q{
     162foo MULTI
    61163bar METADATA
    62164    foo S8      -1
Note: See TracChangeset for help on using the changeset viewer.