fail_on_internal_wantarray fail_on_internal_call
refdesc refcount hrefaddr set_subname describe_class_methods
scope_guard detected_reinvoked_destructor
+ true false
is_exception dbic_internal_try visit_namespaces
quote_sub qsub perlstring serialize deep_clone dump_value uniq
parent_dir mkdir_p
$dump_str;
}
+###
+### This is *NOT* boolean.pm - deliberately not using a singleton
+###
+{
+ package # hide from pause
+ DBIx::Class::_Util::_Bool;
+ use overload
+ bool => sub { ${$_[0]} },
+ fallback => 1,
+ ;
+}
+sub true () { my $x = 1; bless \$x, "DBIx::Class::_Util::_Bool" }
+sub false () { my $x = 0; bless \$x, "DBIx::Class::_Util::_Bool" }
+
sub scope_guard (&) {
croak 'Calling scope_guard() in void context makes no sense'
if ! defined wantarray;
--- /dev/null
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
+use strict;
+use warnings;
+
+use Test::More;
+use DBIx::Class::_Util qw( true false );
+use Scalar::Util 'refaddr';
+
+my @things = ( true, false, true, false, true, false );
+
+for (my $i = 0; $i < $#things; $i++ ) {
+ for my $j ( $i+1 .. $#things ) {
+ cmp_ok
+ refaddr( $things[$i] ),
+ '!=',
+ refaddr( $things[$j] ),
+ "Boolean thingy '$i' distinct from '$j'",
+ ;
+ }
+}
+
+done_testing;