fail_on_internal_wantarray fail_on_internal_call
refdesc refcount hrefaddr set_subname
scope_guard detected_reinvoked_destructor
- is_exception dbic_internal_try
- quote_sub qsub perlstring serialize deep_clone dump_value
+ is_exception dbic_internal_try visit_namespaces
+ quote_sub qsub perlstring serialize deep_clone dump_value uniq
parent_dir mkdir_p
UNRESOLVABLE_CONDITION
);
B::svref_2object($_[0])->REFCNT;
}
+sub visit_namespaces {
+ my $args = { (ref $_[0]) ? %{$_[0]} : @_ };
+
+ my $visited_count = 1;
+
+ # A package and a namespace are subtly different things
+ $args->{package} ||= 'main';
+ $args->{package} = 'main' if $args->{package} =~ /^ :: (?: main )? $/x;
+ $args->{package} =~ s/^:://;
+
+ if ( $args->{action}->($args->{package}) ) {
+ my $ns =
+ ( ($args->{package} eq 'main') ? '' : $args->{package} )
+ .
+ '::'
+ ;
+
+ $visited_count += visit_namespaces( %$args, package => $_ ) for
+ grep
+ # this happens sometimes on %:: traversal
+ { $_ ne '::main' }
+ map
+ { $_ =~ /^(.+?)::$/ ? "$ns$1" : () }
+ do { no strict 'refs'; keys %$ns }
+ ;
+ }
+
+ $visited_count;
+}
+
# FIXME In another life switch this to a polyfill like the one in namespace::clean
sub set_subname ($$) {
nfreeze($_[0]);
}
+sub uniq {
+ my( %seen, $seen_undef, $numeric_preserving_copy );
+ grep { not (
+ defined $_
+ ? $seen{ $numeric_preserving_copy = $_ }++
+ : $seen_undef++
+ ) } @_;
+}
+
my $dd_obj;
sub dump_value ($) {
local $Data::Dumper::Indent = 1
use ExtUtils::MakeMaker;
use DBICTest::RunMode;
-use DBICTest::Util 'visit_namespaces';
+use DBIx::Class::_Util 'visit_namespaces';
use DBIx::Class::Optional::Dependencies;
my $known_paths = {
our @EXPORT_OK = qw(
dbg stacktrace class_seems_loaded
local_umask slurp_bytes tmpdir find_co_root rm_rf
- visit_namespaces PEEPEENESS
+ PEEPEENESS
check_customcond_args
await_flock DEBUG_TEST_CONCURRENCY_LOCKS
);
$args;
}
-sub visit_namespaces {
- my $args = { (ref $_[0]) ? %{$_[0]} : @_ };
-
- my $visited_count = 1;
-
- # A package and a namespace are subtly different things
- $args->{package} ||= 'main';
- $args->{package} = 'main' if $args->{package} =~ /^ :: (?: main )? $/x;
- $args->{package} =~ s/^:://;
-
- if ( $args->{action}->($args->{package}) ) {
- my $ns =
- ( ($args->{package} eq 'main') ? '' : $args->{package} )
- .
- '::'
- ;
-
- $visited_count += visit_namespaces( %$args, package => $_ ) for
- grep
- # this happens sometimes on %:: traversal
- { $_ ne '::main' }
- map
- { $_ =~ /^(.+?)::$/ ? "$ns$1" : () }
- do { no strict 'refs'; keys %$ns }
- ;
- }
-
- return $visited_count;
-}
-
#
# Replicate the *heuristic* (important!!!) implementation found in various
# forms within Class::Load / Module::Inspector / Class::C3::Componentised
use ANFANG;
use Carp;
use Scalar::Util qw(isweak weaken blessed reftype);
-use DBIx::Class::_Util qw(refcount hrefaddr refdesc dump_value);
+use DBIx::Class::_Util qw(refcount hrefaddr refdesc dump_value visit_namespaces);
use DBICTest::RunMode;
-use DBICTest::Util qw( stacktrace visit_namespaces );
+use DBICTest::Util 'stacktrace';
use constant {
CV_TRACING => !!(
!DBICTest::RunMode->is_plain