9 eval { require Encode; };
12 print "1..0 # Skip: Encode is not available\n";
17 require "dbm_filter_util.pl";
19 use Test::More tests => 20;
21 BEGIN { use_ok('DBM_Filter') };
22 BEGIN { use_ok('SDBM_File') };
23 BEGIN { use_ok('Fcntl') };
24 BEGIN { use_ok('charnames', qw{greek})};
26 use charnames qw{greek};
29 END { unlink <Op_dbmx*>; }
32 my $db1 = tie(%h1, 'SDBM_File','Op_dbmx', O_RDWR|O_CREAT, 0640) ;
34 ok $db1, "tied to SDBM_File";
36 eval { $db1->Filter_Push('utf8') };
37 is $@, '', "push a 'utf8' filter" ;
40 no warnings 'uninitialized';
45 'alpha' => "\N{alpha}",
46 "\N{gamma}"=> "gamma",
53 'alpha' => "\N{alpha}",
55 "\N{gamma}"=> "gamma",
61 use warnings FATAL => 'untie';
63 is $@, '', "untie without inner references" ;
66 # read the dbm file without the filter
68 my $db2 = tie(%h2, 'SDBM_File','Op_dbmx', O_RDWR|O_CREAT, 0640) ;
70 ok $db2, "tied to SDBM_File";
74 'alpha' => "\xCE\xB1",
82 use warnings FATAL => 'untie';
84 is $@, '', "untie without inner references" ;