Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
added tests for examples in S16/IO/Special Quoting Syntax
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| use v6; | ||
| use Test; | ||
|
|
||
| plan 11; | ||
| # L<S16::IO/IO/=head2 Special Quoting Syntax> | ||
|
|
||
| # basic | ||
| #?rakudo skip "two terms in a row / unrecognized adverb" | ||
| { | ||
| #?niecza 2 skip "Unhandled exception" | ||
| isa_ok qp{/path/to/file}, IO::Path; | ||
| isa_ok q:p{/path/to/file}, IO::Path; | ||
| is qp{/path/to/file}.path, "/path/to/file"; | ||
| is q:p{/path/to/file}.path, "/path/to/file"; | ||
| } | ||
|
|
||
| #with interpolation | ||
| #?rakudo skip "undeclared routine / urecognized adverb" | ||
| { | ||
| my $dir = "/tmp"; | ||
| my $file = "42"; | ||
| #?niecza skip "too late for: qq" | ||
| isa_ok qp:qq{$dir/$file}, IO::Path; | ||
| isa_ok qq:p{$dir/$file}, IO::Path; | ||
|
|
||
| #?niecza skip "too late for: qq" | ||
| is qp:qq{$dir/$file}.path, "/tmp/42"; | ||
| is qq:p{$dir/$file}.path, "/tmp/42"; | ||
| } | ||
|
|
||
| # :win constraints | ||
| #?rakudo skip "two terms in a row" | ||
| #?niecza skip "confused" | ||
| { | ||
| isa_ok p:win{C:\Program Files\MS Access\file.file}, IO::Path; | ||
|
|
||
| # backlash quoting should be disabled | ||
| ok p:win{c:\no}.path ~~ /no$/; | ||
| } | ||
|
|
||
| # :unix constraints | ||
| #?rakudo skip "Unsupported use of /s" | ||
| #?niecza skip "Unsupported use of suffix regex modifiers" | ||
| { | ||
| isa_ok p:unix{/usr/src/bla/myfile?:%.file}, IO::Path; | ||
| } | ||
|
|