use v6-alpha; use Test; =kwid = DESCRIPTION Tests that the C and list quoting constructs play well together and match well. The following should match: "foo" ~~ any "foo" ~~ any() "bar" ~~ any "bar" ~~ any() The following should not match: "fo" ~~ any "oo" ~~ any "bar b" ~~ any "bar baz" ~~ any() Note: There is a small caveat regarding the convenient C<< any >> syntax, if not used with parentheses: say( any ,"Hello World") is different from say( (any ), "Hello World") =cut my @matching_strings = ; my @nonmatching_strings = ('fo','foo ', 'foo bar baz', 'oo', 'bar b', 'bar baz'); plan ((+@matching_strings+@nonmatching_strings)*2); for @matching_strings -> $str { ok( $str ~~ (any ), "'$str' matches any " ); ok( $str ~~ any(), "'$str' matches any()" ); }; for @nonmatching_strings -> $str { ok( ($str !~~ any ), "'$str' does not match any " ); ok( $str !~~ any(), "'$str' does not match any()" ); };