- Timestamp:
- 09/29/08 22:43:11 (2 months ago)
- Files:
-
- 1 modified
-
t/spec/S05-mass/stdrules.t (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
t/spec/S05-mass/stdrules.t
r22456 r22457 24 24 ok("abc1_2" ~~ m/^ <ident> $/, '<ident>'); 25 25 is($/<ident>, 'abc1_2', 'Captured <ident>'); 26 ok("abc1_2" ~~ m/^ < ?ident> $/, '<?ident>');27 ok(!defined($/<ident>), 'Uncaptured < ?ident>');28 ok(!( "7abc1_2" ~~ m/^ < ?ident> $/ ), 'not <?ident>');29 30 ok("\t \n\t" ~~ m/^ < ?ws> $/, '<?ws>');31 ok(!defined($/<ws>), 'Uncaptured < ?ws>');32 ok(!( "7abc1_2" ~~ m/^ < ?ws> $/ ), 'not <?ws>');33 34 ok(" " ~~ m/^ < ?sp> $/, '<?sp>');35 ok(!defined($/<sp>), 'Uncaptured < ?sp>');36 ok(!( "7abc1_2" ~~ m/< ?sp>/ ), 'not <?sp>');26 ok("abc1_2" ~~ m/^ <.ident> $/, '<.ident>'); 27 ok(!defined($/<ident>), 'Uncaptured <.ident>'); 28 ok(!( "7abc1_2" ~~ m/^ <.ident> $/ ), 'not <.ident>'); 29 30 ok("\t \n\t" ~~ m/^ <.ws> $/, '<.ws>'); 31 ok(!defined($/<ws>), 'Uncaptured <.ws>'); 32 ok(!( "7abc1_2" ~~ m/^ <.ws> $/ ), 'not <.ws>'); 33 34 ok(" " ~~ m/^ <.sp> $/, '<.sp>'); 35 ok(!defined($/<sp>), 'Uncaptured <.sp>'); 36 ok(!( "7abc1_2" ~~ m/<.sp>/ ), 'not <.sp>'); 37 37 38 38 ok(" \t\t \t" ~~ m/^ (\h+) $/, '\h'); … … 46 46 # alpha 47 47 48 ok("A" ~~ m/^< ?alpha>$/, q{Match alpha as subrule});48 ok("A" ~~ m/^<.alpha>$/, q{Match alpha as subrule}); 49 49 ok(!( "A" ~~ m/^<!alpha>.$/ ), q{Don't match negated alpha as subrule} ); 50 50 ok(!( "A" ~~ m/^<-alpha>$/ ), q{Don't match inverted alpha as subrule} ); 51 ok(!( "\x07" ~~ m/^< ?alpha>$/ ), q{Don't match unrelated alpha as subrule} );51 ok(!( "\x07" ~~ m/^<.alpha>$/ ), q{Don't match unrelated alpha as subrule} ); 52 52 ok("\x07" ~~ m/^<!alpha>.$/, q{Match unrelated negated alpha as subrule}); 53 53 ok("\x07" ~~ m/^<-alpha>$/, q{Match unrelated inverted alpha as subrule}); … … 63 63 # space 64 64 65 ok("\x[9]" ~~ m/^< ?space>$/, q{Match space as subrule});65 ok("\x[9]" ~~ m/^<.space>$/, q{Match space as subrule}); 66 66 ok(!( "\x[9]" ~~ m/^<!space>.$/ ), q{Don't match negated space as subrule} ); 67 67 ok(!( "\x[9]" ~~ m/^<-space>$/ ), q{Don't match inverted space as subrule} ); 68 ok(!( "(" ~~ m/^< ?space>$/ ), q{Don't match unrelated space as subrule} );68 ok(!( "(" ~~ m/^<.space>$/ ), q{Don't match unrelated space as subrule} ); 69 69 ok("(" ~~ m/^<!space>.$/, q{Match unrelated negated space as subrule}); 70 70 ok("(" ~~ m/^<-space>$/, q{Match unrelated inverted space as subrule}); … … 81 81 # digit 82 82 83 ok("0" ~~ m/^< ?digit>$/, q{Match digit as subrule});83 ok("0" ~~ m/^<.digit>$/, q{Match digit as subrule}); 84 84 ok(!( "0" ~~ m/^<!digit>.$/ ), q{Don't match negated digit as subrule} ); 85 85 ok(!( "0" ~~ m/^<-digit>$/ ), q{Don't match inverted digit as subrule} ); 86 ok(!( "\x[C]" ~~ m/^< ?digit>$/ ), q{Don't match unrelated digit as subrule} );86 ok(!( "\x[C]" ~~ m/^<.digit>$/ ), q{Don't match unrelated digit as subrule} ); 87 87 ok("\x[C]" ~~ m/^<!digit>.$/, q{Match unrelated negated digit as subrule}); 88 88 ok("\x[C]" ~~ m/^<-digit>$/, q{Match unrelated inverted digit as subrule}); … … 99 99 # alnum 100 100 101 ok("n" ~~ m/^< ?alnum>$/, q{Match alnum as subrule});101 ok("n" ~~ m/^<.alnum>$/, q{Match alnum as subrule}); 102 102 ok(!( "n" ~~ m/^<!alnum>.$/ ), q{Don't match negated alnum as subrule} ); 103 103 ok(!( "n" ~~ m/^<-alnum>$/ ), q{Don't match inverted alnum as subrule} ); 104 ok(!( '{' ~~ m/^< ?alnum>$/ ), q{Don't match unrelated alnum as subrule} );104 ok(!( '{' ~~ m/^<.alnum>$/ ), q{Don't match unrelated alnum as subrule} ); 105 105 ok('{' ~~ m/^<!alnum>.$/, q{Match unrelated negated alnum as subrule}); 106 106 ok('{' ~~ m/^<-alnum>$/, q{Match unrelated inverted alnum as subrule}); … … 119 119 120 120 # Unspecced 121 # ok("+" ~~ m/^< ?ascii>$/, q{Match ascii as subrule});121 # ok("+" ~~ m/^<.ascii>$/, q{Match ascii as subrule}); 122 122 # ok(!( "+" ~~ m/^<!ascii>.$/ ), q{Don't match negated ascii as subrule} ); 123 123 # ok(!( "+" ~~ m/^<-ascii>$/ ), q{Don't match inverted ascii as subrule} ); … … 132 132 # blank 133 133 134 ok("\x[9]" ~~ m/^< ?blank>$/, q{Match blank as subrule});134 ok("\x[9]" ~~ m/^<.blank>$/, q{Match blank as subrule}); 135 135 ok(!( "\x[9]" ~~ m/^<!blank>.$/ ), q{Don't match negated blank as subrule} ); 136 136 ok(!( "\x[9]" ~~ m/^<-blank>$/ ), q{Don't match inverted blank as subrule} ); 137 ok(!( "&" ~~ m/^< ?blank>$/ ), q{Don't match unrelated blank as subrule} );137 ok(!( "&" ~~ m/^<.blank>$/ ), q{Don't match unrelated blank as subrule} ); 138 138 ok("&" ~~ m/^<!blank>.$/, q{Match unrelated negated blank as subrule}); 139 139 ok("&" ~~ m/^<-blank>$/, q{Match unrelated inverted blank as subrule}); … … 150 150 # cntrl 151 151 152 ok("\x[7F]" ~~ m/^< ?cntrl>$/, q{Match cntrl as subrule});152 ok("\x[7F]" ~~ m/^<.cntrl>$/, q{Match cntrl as subrule}); 153 153 ok(!( "\x[7F]" ~~ m/^<!cntrl>.$/ ), q{Don't match negated cntrl as subrule} ); 154 154 ok(!( "\x[7F]" ~~ m/^<-cntrl>$/ ), q{Don't match inverted cntrl as subrule} ); 155 ok(!( "=" ~~ m/^< ?cntrl>$/ ), q{Don't match unrelated cntrl as subrule} );155 ok(!( "=" ~~ m/^<.cntrl>$/ ), q{Don't match unrelated cntrl as subrule} ); 156 156 ok("=" ~~ m/^<!cntrl>.$/, q{Match unrelated negated cntrl as subrule}); 157 157 ok("=" ~~ m/^<-cntrl>$/, q{Match unrelated inverted cntrl as subrule}); … … 168 168 # graph 169 169 170 ok("V" ~~ m/^< ?graph>$/, q{Match graph as subrule});170 ok("V" ~~ m/^<.graph>$/, q{Match graph as subrule}); 171 171 ok(!( "V" ~~ m/^<!graph>.$/ ), q{Don't match negated graph as subrule} ); 172 172 ok(!( "V" ~~ m/^<-graph>$/ ), q{Don't match inverted graph as subrule} ); 173 ok(!( "\x[7F]" ~~ m/^< ?graph>$/ ), q{Don't match unrelated graph as subrule} );173 ok(!( "\x[7F]" ~~ m/^<.graph>$/ ), q{Don't match unrelated graph as subrule} ); 174 174 ok("\x[7F]" ~~ m/^<!graph>.$/, q{Match unrelated negated graph as subrule}); 175 175 ok("\x[7F]" ~~ m/^<-graph>$/, q{Match unrelated inverted graph as subrule}); … … 186 186 # lower 187 187 188 ok("a" ~~ m/^< ?lower>$/, q{Match lower as subrule});188 ok("a" ~~ m/^<.lower>$/, q{Match lower as subrule}); 189 189 ok(!( "a" ~~ m/^<!lower>.$/ ), q{Don't match negated lower as subrule} ); 190 190 ok(!( "a" ~~ m/^<-lower>$/ ), q{Don't match inverted lower as subrule} ); 191 ok(!( "\x[1E]" ~~ m/^< ?lower>$/ ), q{Don't match unrelated lower as subrule} );191 ok(!( "\x[1E]" ~~ m/^<.lower>$/ ), q{Don't match unrelated lower as subrule} ); 192 192 ok("\x[1E]" ~~ m/^<!lower>.$/, q{Match unrelated negated lower as subrule}); 193 193 ok("\x[1E]" ~~ m/^<-lower>$/, q{Match unrelated inverted lower as subrule}); … … 204 204 # print 205 205 206 ok("M" ~~ m/^< ?print>$/, q{Match print as subrule});206 ok("M" ~~ m/^<.print>$/, q{Match print as subrule}); 207 207 ok(!( "M" ~~ m/^<!print>.$/ ), q{Don't match negated print as subrule} ); 208 208 ok(!( "M" ~~ m/^<-print>$/ ), q{Don't match inverted print as subrule} ); 209 ok(!( "\x[7F]" ~~ m/^< ?print>$/ ), q{Don't match unrelated print as subrule} );209 ok(!( "\x[7F]" ~~ m/^<.print>$/ ), q{Don't match unrelated print as subrule} ); 210 210 ok("\x[7F]" ~~ m/^<!print>.$/, q{Match unrelated negated print as subrule}); 211 211 ok("\x[7F]" ~~ m/^<-print>$/, q{Match unrelated inverted print as subrule}); … … 222 222 # punct 223 223 224 ok("[" ~~ m/^< ?punct>$/, q{Match punct as subrule});224 ok("[" ~~ m/^<.punct>$/, q{Match punct as subrule}); 225 225 ok(!( "[" ~~ m/^<!punct>.$/ ), q{Don't match negated punct as subrule} ); 226 226 ok(!( "[" ~~ m/^<-punct>$/ ), q{Don't match inverted punct as subrule} ); 227 ok(!( "F" ~~ m/^< ?punct>$/ ), q{Don't match unrelated punct as subrule} );227 ok(!( "F" ~~ m/^<.punct>$/ ), q{Don't match unrelated punct as subrule} ); 228 228 ok("F" ~~ m/^<!punct>.$/, q{Match unrelated negated punct as subrule}); 229 229 ok("F" ~~ m/^<-punct>$/, q{Match unrelated inverted punct as subrule}); … … 240 240 # upper 241 241 242 ok("A" ~~ m/^< ?upper>$/, q{Match upper as subrule});242 ok("A" ~~ m/^<.upper>$/, q{Match upper as subrule}); 243 243 ok(!( "A" ~~ m/^<!upper>.$/ ), q{Don't match negated upper as subrule} ); 244 244 ok(!( "A" ~~ m/^<-upper>$/ ), q{Don't match inverted upper as subrule} ); 245 ok(!( "\x[5F]" ~~ m/^< ?upper>$/ ), q{Don't match unrelated upper as subrule} );245 ok(!( "\x[5F]" ~~ m/^<.upper>$/ ), q{Don't match unrelated upper as subrule} ); 246 246 ok("\x[5F]" ~~ m/^<!upper>.$/, q{Match unrelated negated upper as subrule}); 247 247 ok("\x[5F]" ~~ m/^<-upper>$/, q{Match unrelated inverted upper as subrule}); … … 259 259 # word 260 260 # unspecced 261 # ok("b" ~~ m/^< ?word>$/, q{Match word as subrule});261 # ok("b" ~~ m/^<.word>$/, q{Match word as subrule}); 262 262 # ok(!( "b" ~~ m/^<!word>.$/ ), q{Don't match negated word as subrule} ); 263 263 # ok(!( "b" ~~ m/^<-word>$/ ), q{Don't match inverted word as subrule} ); 264 # ok(!( '{' ~~ m/^< ?word>$/ ), q{Don't match unrelated word as subrule} );264 # ok(!( '{' ~~ m/^<.word>$/ ), q{Don't match unrelated word as subrule} ); 265 265 # ok('{' ~~ m/^<!word>.$/, q{Match unrelated negated word as subrule} ); 266 266 # ok('{' ~~ m/^<-word>$/, q{Match unrelated inverted word as subrule}); … … 277 277 # xdigit 278 278 279 ok("0" ~~ m/^< ?xdigit>$/, q{Match xdigit as subrule});279 ok("0" ~~ m/^<.xdigit>$/, q{Match xdigit as subrule}); 280 280 ok(!( "0" ~~ m/^<!xdigit>.$/ ), q{Don't match negated xdigit as subrule} ); 281 281 ok(!( "0" ~~ m/^<-xdigit>$/ ), q{Don't match inverted xdigit as subrule} ); 282 ok(!( "}" ~~ m/^< ?xdigit>$/ ), q{Don't match unrelated xdigit as subrule} );282 ok(!( "}" ~~ m/^<.xdigit>$/ ), q{Don't match unrelated xdigit as subrule} ); 283 283 ok("}" ~~ m/^<!xdigit>.$/, q{Match unrelated negated xdigit as subrule}); 284 284 ok("}" ~~ m/^<-xdigit>$/, q{Match unrelated inverted xdigit as subrule});
