6 use Test::More tests => 5;
8 use Hash::Normalize qw<normalize get_normalization>;
10 my $cafe_nfc = "caf\x{e9}";
11 my $cafe_nfd = "cafe\x{301}";
14 package Hash::Normalize::TestPkg;
16 BEGIN { Hash::Normalize::normalize(%Hash::Normalize::TestPkg::) }
18 sub $cafe_nfd { return 123 }
20 sub get_coffee_nfc { $cafe_nfc() + 1 }
22 sub get_coffee_nfd { $cafe_nfd() + 2 }
24 package Hash::Normalize::TestPkg2;
28 \@ISA = 'Hash::Normalize::TestPkg';
34 is $@, '', 'test package compiled properly';
37 skip 'eval suffers from The Unicode Bug before perl 5.16' => 4
40 is Hash::Normalize::TestPkg::get_coffee_nfc(), 124, 'nfc func call';
41 is Hash::Normalize::TestPkg::get_coffee_nfd(), 125, 'nfd func call';
42 is Hash::Normalize::TestPkg2->get_coffee_nfc(), 124, 'nfc meth call';
43 is Hash::Normalize::TestPkg2->get_coffee_nfd(), 125, 'nfd meth call';