Format
Qwiratry::Test::Format
Reusable conformance ("contract") tests for Qwiratry format plugins.
A format plugin provides Qwiratry::Format::<NAME>::Parse and/or
Qwiratry::Format::<NAME>::Render classes that inherit the contracts in
Qwiratry::Format::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, parse/render behave, the
format round-trips when it claims to be lossless, and it works through the
↱ / ↴ pipeline operators.
Synopsis
use Test;
use Qwiratry::Test::Format;
conforms-to-format-contract(
format => 'JSON',
parse-samples => [ '{"a":1}', '[1,2,3]' ],
render-values => [ { :a(1) }, [1, 2, 3] ],
:lossless,
);
done-testing;
The one required argument is :format. Everything else is capability-driven:
supply only the samples/flags that apply to the format under test.
Requires
RAKUDO_RAKUAST=1 (inherited from Qwiratry's slang).