6 BEGIN { delete $ENV{PATH} }
8 use Test::More tests => 2 * 7;
10 use Test::Valgrind::Suppressions;
13 [ 'malloc' => 'malloc', 'not encoded' ],
14 [ '_vgrZU_VG_Z_dongs' => qr/Symbol with a "VG_Z_" prefix is invalid/, 'VG_Z' ],
15 [ '_vgrZU_dongs' => qr/Symbol doesn't contain a function name/,
17 [ '_vgrZU_libcZdsoZa_malloc' => 'malloc', 'soname encoded' ],
18 [ '_vgrZU_libcZdsoZa_arZZZAel' => 'arZZZAel', 'soname encoded 2' ],
19 [ '_vgrZZ_libcZdsoZa_arZZZAel' => 'arZ@el', 'function name encoded' ],
20 [ '_vgrZZ_libcZdsoZa_arZdZXZa' => qr/Invalid escape sequence/,
21 'function name with invalid escapes' ],
25 my ($sym, $exp, $desc) = @$_;
26 my $res = eval { Test::Valgrind::Suppressions->maybe_z_demangle($sym) };
28 like $@, $exp, "$desc croaks as expected";
29 is $res, undef, $desc;
31 is $@, '', "$desc does not croak as expected";