IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 9477


Ignore:
Timestamp:
Oct 10, 2006, 4:45:20 PM (20 years ago)
Author:
jhoblitt
Message:

check TYPE/MULTI parse trees

File:
1 edited

Legend:

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

    r7830 r9477  
    33# Copyright (C) 2005  Joshua Hoblitt
    44#
    5 # $Id: 06_multi.t,v 1.6 2006-07-06 21:49:28 jhoblitt Exp $
     5# $Id: 06_multi.t,v 1.7 2006-10-11 02:45:20 jhoblitt Exp $
    66
    77use strict;
     
    1212#$::RD_TRACE = 1;
    1313
    14 use Test::More tests => 13;
     14use Test::More tests => 14;
    1515use PS::IPP::Metadata::Config;
    1616
     
    128128    my $config = PS::IPP::Metadata::Config->new->parse( $example );
    129129    ok( defined( $config ), "MULTI TYPE");
     130
     131    my $tree = [
     132        {
     133            name    => 'foo',
     134            class   => 'metadata',
     135            value   => [
     136                {
     137                    name    => 'a',
     138                    class   => 'scalar',
     139                    type    => 'STR',
     140                    value   => 'x',
     141                },
     142                {
     143                    name    => 'b',
     144                    class   => 'scalar',
     145                    type    => 'STR',
     146                    value   => 'y',
     147                },
     148                {
     149                    name    => 'c',
     150                    class   => 'scalar',
     151                    type    => 'STR',
     152                    value   => 'z',
     153                },
     154            ],
     155        },
     156        {
     157            name    => 'foo',
     158            class   => 'metadata',
     159            value   => [
     160                {
     161                    name    => 'a',
     162                    class   => 'scalar',
     163                    type    => 'STR',
     164                    value   => 'x',
     165                },
     166                {
     167                    name    => 'b',
     168                    class   => 'scalar',
     169                    type    => 'STR',
     170                    value   => 'y',
     171                },
     172                {
     173                    name    => 'c',
     174                    class   => 'scalar',
     175                    type    => 'STR',
     176                    value   => 'z',
     177                },
     178            ],
     179        },
     180    ];
     181
     182    is_deeply( $config, $tree, "MULTI TYPE structure, not declared" );
    130183}
    131184
     
    137190foo  bar x y z
    138191};
    139     my $config = PS::IPP::Metadata::Config->new->parse( $example );
    140 
     192
     193    my $config = PS::IPP::Metadata::Config->new->parse( $example );
    141194    ok( defined( $config ), "MULTI TYPE");
     195
     196    my $tree = [
     197        {
     198            name    => 'foo',
     199            class   => 'metadata',
     200            value   => [
     201                {
     202                    name    => 'a',
     203                    class   => 'scalar',
     204                    type    => 'STR',
     205                    value   => 'x',
     206                },
     207                {
     208                    name    => 'b',
     209                    class   => 'scalar',
     210                    type    => 'STR',
     211                    value   => 'y',
     212                },
     213                {
     214                    name    => 'c',
     215                    class   => 'scalar',
     216                    type    => 'STR',
     217                    value   => 'z',
     218                },
     219            ],
     220        },
     221        {
     222            name    => 'foo',
     223            class   => 'metadata',
     224            value   => [
     225                {
     226                    name    => 'a',
     227                    class   => 'scalar',
     228                    type    => 'STR',
     229                    value   => 'x',
     230                },
     231                {
     232                    name    => 'b',
     233                    class   => 'scalar',
     234                    type    => 'STR',
     235                    value   => 'y',
     236                },
     237                {
     238                    name    => 'c',
     239                    class   => 'scalar',
     240                    type    => 'STR',
     241                    value   => 'z',
     242                },
     243            ],
     244        },
     245    ];
     246
     247    is_deeply( $config, $tree, "MULTI TYPE structure, not declared" );
    142248}
    143249
Note: See TracChangeset for help on using the changeset viewer.