File: signature_error_handler.t

package info (click to toggle)
libmethod-signatures-perl 20170211-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 672 kB
  • sloc: perl: 3,860; makefile: 2
file content (21 lines) | stat: -r--r--r-- 432 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

use strict;
use warnings;

use Test::More;

use lib 't/lib';
use My::Method::Signatures { compile_at_BEGIN => 0 };

func no_sig { return @_ }

note "signature_error_handler"; {
    ok !eval { no_sig(42); 1 }, "no args";
    my $exception = $@;
    isa_ok($exception, 'My::ExceptionClass');
    my $msg = $exception->{message};
    like $msg, qr{no_sig\(\).*given too many arguments.*it expects 0};
}

done_testing;