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).

Qwiratry::Test v0.0.1

Reusable conformance ('contract') test kit for Qwiratry Format and Location plugins.

Authors

  • Tim Nelson

License

Dependencies

Test Dependencies

Provides

  • Qwiratry::Test::Format
  • Qwiratry::Test::Location

The Camelia image is copyright 2009 by Larry Wall. "Raku" is a trademark of the Yet Another Society. All rights reserved.

Built with Podlite — the markup and publishing tools behind this site.