6 @INC = qw(: ::lib ::macos:lib);
22 sub ok { print "ok $test\n"; $test++ }
27 package Testing::Symtable;
28 use vars qw($This @That %wibble $moo %moo);
29 my $not_a_sym = 'moo';
35 package Testing::Symtable::Foo;
38 package Testing::Symtable::Bar;
44 B::walksymtable(\%Testing::Symtable::, 'find_syms', sub { $_[0] =~ /Foo/ },
45 'Testing::Symtable::');
47 sub B::GV::find_syms {
50 $main::Subs{$symbol->STASH->NAME . '::' . $symbol->NAME}++;
53 my @syms = map { 'Testing::Symtable::'.$_ } qw(This That wibble moo car
55 push @syms, "Testing::Symtable::Foo::yarrow";
57 # Make sure we hit all the expected symbols.
58 print "not " unless join('', sort @syms) eq join('', sort keys %Subs);
61 # Make sure we only hit them each once.
62 print "not " unless !grep $_ != 1, values %Subs;