Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IO::Path.dir may be using the wrong CWD #6658

Closed
p6rt opened this issue Jan 2, 2018 · 4 comments
Closed

IO::Path.dir may be using the wrong CWD #6658

p6rt opened this issue Jan 2, 2018 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Jan 2, 2018

Migrated from rt.perl.org#132675 (status was 'resolved')

Searchable as RT132675$

@p6rt
Copy link
Author

p6rt commented Jan 2, 2018

From @dakkar

IO​::Path.dir uses the global $*CWD to construct the objects it
returns; it should probably use the invocant's $!CWD instead.

This test currently fails​:

  use v6.c;
  use Test;

  mkdir('/tmp/one/two');

  for IO​::Path.new('one',​:CWD</tmp/>).dir -> $d {
  ok $d ~~ :e, "{$d.perl} should exist";
  }

  done-testing;

while this passes​:

  for IO​::Path.new('/tmp/one/two').dir -> $d {
  ok $d ~~ :e, "{$d.perl} should exist";
  }

I think they should both pass.

--
  Dakkar - <Mobilis in mobile>
  GPG public key fingerprint = A071 E618 DD2C 5901 9574
  6FE2 40EA 9883 7519 3F88
  key id = 0x75193F88

@p6rt
Copy link
Author

p6rt commented Jan 2, 2018

From @zoffixznet

On Tue, 02 Jan 2018 04​:23​:34 -0800, dakkar wrote​:

IO​::Path.dir uses the global $*CWD to construct the objects it
returns; it should probably use the invocant's $!CWD instead.

This test currently fails​:

use v6.c;
use Test;

mkdir('/tmp/one/two');

for IO​::Path.new('one',​:CWD</tmp/>).dir -> $d {
ok $d ~~ :e, "{$d.perl} should exist";
}

done-testing;

while this passes​:

for IO​::Path.new('/tmp/one/two').dir -> $d {
ok $d ~~ :e, "{$d.perl} should exist";
}

I think they should both pass.

Thank you for the report. This is now fixed.

Fix​: rakudo/rakudo@b3e73b64a28ff72
Test​: Raku/roast@5f83c043f0d2d02f9

@p6rt
Copy link
Author

p6rt commented Jan 2, 2018

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 2, 2018

@zoffixznet - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant