#!perl

=head1 call-metrics-asperl.t

Test that metrics()' result is correctly deserialised by
metrics_asperl().

=cut

use v5.14;
use lib 't/lib';
use Test::Most tests => 4;
use Test::Net::Async::Graphite;

for (qw(expand find index index.json)) {
  # TODO: random strings
  my $target   = 'this.thing';
  my $fxt_perl = { "6x7" => "42" };
  my $fxt_json = '{ "6x7": "42" }';
  Test::Net::Async::Graphite::test_api(
    endpoint => 'any://thing/',
    method   => 'metrics/' . $_,
    content  => $fxt_json,
    target   => $target,
    param    => { query => $target },
    asperl   => $fxt_perl,
  );
}
