Debian Codegraph @

t/ffi_platypus_typeparser.t

raw
1 use Test2::V0 -no_srand => 1;
2 use FFI::Platypus;
3 use FFI::Platypus::TypeParser;
4
5 subtest 'basic' => sub {
6
7 my $tp = FFI::Platypus::TypeParser->new;
8 isa_ok $tp, 'FFI::Platypus::TypeParser';
9
10 };
11
12 subtest 'pick the right one' => sub {
13
14 isa_ok(
15 FFI::Platypus->new( api => 0 )->{tp},
16 'FFI::Platypus::TypeParser::Version0',
17 );
18
19 # ignore api=1 warning
20 local $SIG{__WARN__} = sub { note "[warnings]\n", $_[0] };
21
22 isa_ok(
23 FFI::Platypus->new( api => 1 )->{tp},
24 'FFI::Platypus::TypeParser::Version1',
25 );
26
27 };
28
29 done_testing;