Location
Qwiratry::Test::Location
Reusable conformance ("contract") tests for Qwiratry location plugins.
A location plugin provides Qwiratry::Location::<NAME>::Source and/or
Qwiratry::Location::<NAME>::Destination classes that inherit the contracts in
Qwiratry::Location::Base. This module asserts, from the outside, that such a
plugin satisfies the shared contract: it is discoverable through the factory,
its operation classes inherit the correct base, its URI scheme resolves to the
backend, it round-trips (when writable and readable), reports missing locations
as X::Qwiratry::IO::LocationError, and works through the ⮳ / ⮷
pipeline operators.
Synopsis
use Test;
use Qwiratry::Test::Location;
my $tmp = $*TMPDIR.add("qwiratry-{$*PID}.txt").absolute;
conforms-to-location-contract(
backend => 'File',
scheme => 'file',
sample-location => $tmp,
roundtrip-location => $tmp,
missing-location => $*TMPDIR.add("does-not-exist-{$*PID}").absolute,
);
done-testing;
Network-backed backends should pass :needs-network; those subtests are
skipped unless QWIRATRY_TEST_NETWORK is set, so plugin CI stays hermetic by
default.
Requires
RAKUDO_RAKUAST=1 (inherited from Qwiratry's slang).