File: die.t

package info (click to toggle)
libtime-format-perl 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 248 kB
  • ctags: 34
  • sloc: perl: 522; makefile: 4
file content (18 lines) | stat: -rwxr-xr-x 362 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/perl -I..

# Test some error cases

use strict;
use Test::More tests => 3;

BEGIN { $Time::Format::NOXS = 1 }
BEGIN { use_ok 'Time::Format', qw(:all) }
my $err = 'Invalid call to Time::Format internal function';
my $len = length $err;

eval '$time{foo} = 1';
is substr($@,0,$len), $err,  'Store';

eval '%strftime = ()';
is substr($@,0,$len), $err, 'Clear';