File: export3.t

package info (click to toggle)
libtime-format-perl 1.16-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 300 kB
  • sloc: perl: 653; makefile: 4
file content (18 lines) | stat: -rw-r--r-- 864 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/perl

use Test::More tests => 7;

BEGIN { $Time::Format::NOXS = 1 }
BEGIN { use_ok 'Time::Format', qw(%manip time_format time_manip) }

# hashes exported properly?
is ref tied %time,     ''            => '%time not exported when it should not be';
is ref tied %strftime, ''            => '%strftime not exported when it should not be';
is ref tied %manip,    Time::Format  => '%manip exported when explicitly requested';
eval {%time     = ()};   # suppress "used only once" warning
eval {%strftime = ()};   # suppress "used only once" warning

# functions exported properly?
ok  defined &time_format             => 'time_format exported when explicitly requested';
ok !defined &time_strftime           => 'time_strftime not exported when not requested';
ok  defined &time_manip              => 'time_manip exported when explicitly requested';