File: util-namemap.t

package info (click to toggle)
libsub-exporter-perl 0.984-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 316 kB
  • sloc: perl: 2,200; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (7)
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
#!perl -T
use strict;
use warnings;

use Test::More skip_all => 'not actually offerring this feature yet';

# use Test::More tests => 3;

BEGIN { use_ok("Sub::Exporter::Util", 'name_map'); }

is_deeply(
  {
    name_map(
      '_?_gen'  => [ qw(fee fie) ],
      '_make_?' => [ qw(foo bar) ],
    ),
  },
  {
    fee => \'_fee_gen',
    fie => \'_fie_gen',
    foo => \'_make_foo',
    bar => \'_make_bar',
  },
  'example from docs works just dandy',
);

eval { name_map(foo => [ qw(bar) ] ) };
like($@, qr/no \?/, 'exception raised with no ? in template');