Advertisement
Guest User

Untitled

a guest
May 30th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. use v6;
  2.  
  3. use Test;
  4.  
  5. plan 12;
  6.  
  7. $_ = "here is some foo";
  8. my $rx1 = "some foo";
  9. my $rx2 = "(some) foo";
  10.  
  11. my regex a {:s (some) foo }
  12. my regex b {:s $rx1 }
  13. my regex c {:s $rx2 }
  14. my regex d {:s {$rx1} }
  15. my regex e {:s {$rx2} }
  16.  
  17. isa-ok $_ ~~ /<a>/, Match;
  18. isa-ok $_ ~~ /<b>/, Match;
  19. isa-ok $_ ~~ /<c>/, Match;
  20. isa-ok $_ ~~ /<d>/, Match;
  21. isa-ok $_ ~~ /<e>/, Match;
  22. isa-ok $_ ~~ $rx1, Match;
  23. isa-ok $_ ~~ $rx2, Match;
  24. isa-ok $_ ~~ /$rx1/, Match;
  25. isa-ok $_ ~~ /$rx2/, Match;
  26. isa-ok $_ ~~ /{$rx1}/, Match;
  27. isa-ok $_ ~~ /{$rx2}/, Match;
  28. isa-ok $_ ~~ /:s (some) foo/, Match;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement