File: ffi_platypus_typeparser.t

package info (click to toggle)
libffi-platypus-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,860 kB
  • sloc: perl: 7,388; ansic: 6,862; cpp: 53; sh: 19; makefile: 14
file content (29 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (2)
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
use Test2::V0 -no_srand => 1;
use FFI::Platypus;
use FFI::Platypus::TypeParser;

subtest 'basic' => sub {

  my $tp = FFI::Platypus::TypeParser->new;
  isa_ok $tp, 'FFI::Platypus::TypeParser';

};

subtest 'pick the right one' => sub {

  isa_ok(
    FFI::Platypus->new( api => 0 )->{tp},
    'FFI::Platypus::TypeParser::Version0',
  );

  # ignore api=1 warning
  local $SIG{__WARN__} = sub { note "[warnings]\n", $_[0] };

  isa_ok(
    FFI::Platypus->new( api => 1 )->{tp},
    'FFI::Platypus::TypeParser::Version1',
  );

};

done_testing;