diff --git a/S32-io/IO-Socket-INET-UNIX.t b/S32-io/IO-Socket-INET-UNIX.t index 6a1cefb28d..0a43dfa772 100644 --- a/S32-io/IO-Socket-INET-UNIX.t +++ b/S32-io/IO-Socket-INET-UNIX.t @@ -1,5 +1,7 @@ use v6; +use lib $?FILE.IO.parent.sibling: 'packages/Test-Helpers/lib'; use Test; +use Test::Util; plan 8; @@ -11,10 +13,9 @@ if $*DISTRO.is-win { my IO::Socket::INET:_ $server; my IO::Socket::INET:_ $client; my IO::Socket::INET:_ $accepted; - my Str:D $host = "./test-$*PID-{(1..1_000).pick}.sock"; + 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; @@ -40,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