Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added tests for examples in S16/IO/Special Quoting Syntax
  • Loading branch information
dagurval committed May 10, 2013
1 parent 7f7fa6e commit 899d9a7
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions S16-io/quoting-syntax.t
@@ -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;
}

0 comments on commit 899d9a7

Please sign in to comment.