File: signatures.t

package info (click to toggle)
libsyntax-keyword-assert-perl 0.16-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 196 kB
  • sloc: perl: 98; pascal: 69; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 361 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use Test2::V0;
use Test2::Require::Perl 'v5.36';

use feature qw(signatures);

use Syntax::Keyword::Assert;

subtest 'Test `assert` with signatures' => sub {

    my sub hello($name) {
        assert ( defined $name );
        return "Hello, $name!";
    }

    ok lives {
        hello('world');
    };

    ok dies {
        hello();
    };
};

done_testing;