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