File: load-perisprop-module.t

package info (click to toggle)
libperinci-sub-normalize-perl 0.207-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 302; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 966 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!perl

use 5.010;
use strict;
use warnings;

use Perinci::Sub::Normalize qw(normalize_function_metadata);
use Test::Exception;
use Test::More 0.98;

subtest retry => sub {
    plan skip_all => "Perinci::Sub::Property::retry 0.10 not installed"
        unless eval "use Perinci::Sub::Property::retry 0.10; 1";

    is_deeply(normalize_function_metadata({v=>1.1, retry=>2}),
              {v=>1.1, retry=>2});
};

subtest retry => sub {
    plan skip_all => "Perinci::Sub::Property::result::table 0.08 not installed"
        unless eval "use Perinci::Sub::Property::result::table 0.08; 1";

    is_deeply(normalize_function_metadata({v=>1.1, result=>{table=>{}}}),
              {v=>1.1, result=>{table=>{}}});
};

dies_ok { normalize_function_metadata({v=>1.1, foo=>1}) }
        "doesn't allow unknown properties";
dies_ok { normalize_function_metadata({v=>1.1, result=>{foo=>1}}) }
        "doesn't allow unknown result properties";

DONE_TESTING:
done_testing();