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

Change directory to $*TMPDIR #732

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions S32-io/IO-Socket-INET-UNIX.t
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
use v6;
use lib $?FILE.IO.parent.sibling: 'packages/Test-Helpers/lib';
use Test;
use Test::Util;

plan 8;

if $*DISTRO.is-win {
skip-rest 'UNIX socket support on Windows NYI';
} else {
chdir $*TMPDIR;

my IO::Socket::INET:_ $server;
my IO::Socket::INET:_ $client;
my IO::Socket::INET:_ $accepted;
my Str:D $host = $*TMPDIR.add("test-$*PID.sock").Str;
my Str:D $host = ~make-temp-path.relative;
my Str:D $sent = 'Hello, world!';
my Str:_ $received;
LEAVE $host.IO.unlink if $host.IO.e;

lives-ok {
$server = IO::Socket::INET.listen: $host, 0, family => PF_UNIX;
Expand All @@ -38,6 +41,8 @@ if $*DISTRO.is-win {
lives-ok {
$server.close;
}, 'can close TCP UNIX socket servers';

# Test::Util takes care of cleanup.
}

# vim: expandtab shiftwidth=4