Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created September 29, 2017 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/3320ed4897ffa9b651775fc961f4d43d to your computer and use it in GitHub Desktop.
Save zoffixznet/3320ed4897ffa9b651775fc961f4d43d to your computer and use it in GitHub Desktop.
use v6.d.PREVIEW;
use lib <t/spec/packages/>;
use Test;
use Test::Util;
subtest '.open with "-" as path in 6.d lang is no longer special' => {
plan 3;
indir make-temp-dir, {
(my $fh will leave {.close} = open '-', :w).spurt: 'foo';
is-deeply open('-').slurp, 'foo', '&open(Str)';
}
indir make-temp-dir, {
(my $fh will leave {.close} = open '-'.IO, :w).spurt: 'foo';
is-deeply open('-'.IO).slurp, 'foo', '&open(Str)';
}
indir make-temp-dir, {
(my $fh will leave {.close} = '-'.IO.open: :w).spurt: 'foo';
is-deeply '-'.IO.open.slurp, 'foo', 'IO::Path.open';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment