Changeset 7830 for trunk/PS-IPP-Metadata-Config/t/06_multi.t
- Timestamp:
- Jul 6, 2006, 11:49:28 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Metadata-Config/t/06_multi.t (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Metadata-Config/t/06_multi.t
r3496 r7830 3 3 # Copyright (C) 2005 Joshua Hoblitt 4 4 # 5 # $Id: 06_multi.t,v 1. 5 2005-03-24 22:32:55jhoblitt Exp $5 # $Id: 06_multi.t,v 1.6 2006-07-06 21:49:28 jhoblitt Exp $ 6 6 7 7 use strict; … … 15 15 use PS::IPP::Metadata::Config; 16 16 17 my $config_parser = PS::IPP::Metadata::Config->new;18 19 17 { 20 18 my $example = q{ … … 24 22 foo BOOL T 25 23 }; 26 my $config = $config_parser->parse( $example );24 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 27 25 ok( defined( $config ), "basic MULTI"); 28 26 } … … 35 33 foo BOOL T # 36 34 }; 37 my $config = $config_parser->parse( $example );35 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 38 36 ok( defined( $config ), "MULTI with comments"); 39 37 } … … 52 50 END 53 51 }; 54 my $config = $config_parser->parse( $example );52 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 55 53 ok( defined( $config ), "MULTI not visible in lower scopes"); 56 54 } … … 66 64 END 67 65 }; 68 my $config = $config_parser->parse( $example ); 69 ok( defined( $config ), "MULTI METADATA"); 70 } 71 72 { 73 my $example = q{ 74 foo METADATA 75 bar BOOL T 76 END 77 foo METADATA 78 bar BOOL T 79 END 80 }; 81 my $config = $config_parser->parse( $example ); 66 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 82 67 83 68 my $tree = [ … … 92 77 }], 93 78 }, 79 { 80 name => 'foo', 81 class => 'metadata', 82 value => [{ 83 name => 'bar', 84 class => 'scalar', 85 type => 'BOOL', 86 value => 1, 87 }], 88 }, 94 89 ]; 95 90 91 is_deeply( $config, $tree, "MULTI METADATA structure, declared" ); 92 } 93 94 { 95 my $example = q{ 96 foo METADATA 97 bar BOOL T 98 END 99 foo METADATA 100 bar BOOL T 101 END 102 }; 103 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 104 105 my $tree = [ 106 { 107 name => 'foo', 108 class => 'metadata', 109 value => [{ 110 name => 'bar', 111 class => 'scalar', 112 type => 'BOOL', 113 value => 1, 114 }], 115 }, 116 ]; 117 96 118 is_deeply( $config, $tree, "MULTI METADATA structure, not declared" ); 97 119 } … … 104 126 foo bar x y z 105 127 }; 106 my $config = $config_parser->parse( $example );128 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 107 129 ok( defined( $config ), "MULTI TYPE"); 108 130 } … … 115 137 foo bar x y z 116 138 }; 117 my $config = $config_parser->parse( $example );139 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 118 140 119 141 ok( defined( $config ), "MULTI TYPE"); … … 126 148 foo bar x y z 127 149 }; 128 my $config = $config_parser->parse( $example );150 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 129 151 130 152 my $tree = [ … … 166 188 END 167 189 }; 168 my $config = $config_parser->parse( $example );190 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 169 191 # ok because of overwrite 170 192 ok( defined( $config ), "MULTI not in scope"); … … 179 201 foo STR bar baz 180 202 }; 181 my $config = $config_parser->parse( $example );203 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 182 204 # ok because of overwrite 183 205 ok( defined( $config ), "MULTI not in scope"); … … 193 215 END 194 216 }; 195 my $config = $config_parser->parse( $example );217 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 196 218 # ok because of overwrite 197 219 ok( defined( $config ), "MULTI not in scope"); … … 204 226 foo S8 -1 205 227 }; 206 my $config = $config_parser->parse( $example );228 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 207 229 ok( !defined( $config ), "MULTI redeclaration"); 208 230 } … … 213 235 foo STR bar baz 214 236 }; 215 my $config = $config_parser->parse( $example );237 my $config = PS::IPP::Metadata::Config->new->parse( $example ); 216 238 # ok because of overwrite 217 239 ok( defined( $config ), "missing MULTI declaration");
Note:
See TracChangeset
for help on using the changeset viewer.
