File: 07apply.t

package info (click to toggle)
libattribute-storage-perl 0.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 172 kB
  • sloc: perl: 499; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 445 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
25
#!/usr/bin/perl

use v5.14;
use warnings;

use Test2::V0;

use Attribute::Storage qw( get_subattr get_subattrs apply_subattrs );

sub Title :ATTR(CODE)
{
   my $package = shift;
   my ( $title ) = @_;

   return "" unless defined $title;
   return $title;
}

my $code = apply_subattrs
   Title => '"Here is my title"',
   sub { };

is( get_subattr( $code, "Title" ), "Here is my title", 'apply_subattrs can set Title on $code' );

done_testing;