Leser: 2
6 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
t/11_load.................NOK 2/5
# Failed test 'Loading a missing class'
# at t/11_load.t line 13.
# 'Can't use string ("c1::") as a HASH ref while "strict refs" in use at /root/.cpan/build/OOTools-2.21-kx3KPN/blib/lib/Class/Util.pm line 30.
# '
# doesn't match '(?-xism:^Can't locate)'
t/11_load.................NOK 3/5
# Failed test 'Re-loading a loaded class'
# at t/11_load.t line 21.
# Looks like you failed 2 tests of 5.
t/11_load.................dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 2-3
Failed 2/5 tests, 60.00% okay
1 2 3 4 5 6 7 8 9 10
; sub load { local $_ = $_[0] if defined $_[0] ; my $r = eval "require $_;" ; if ($@) { (my $c = $_.'.pm') =~ s|\b::\b|/|g ; croak $@ if $@ !~ /^Can't locate $c in \@INC/ || not defined %{$_.'::'} # <--- Zeile 30 } ; $r }
1 2 3 4 5 6 7 8 9 10 11
sub load { local $_ = $_[0] if defined $_[0]; my $r = eval "require $_;"; if ($@) { ( my $c = $_ . '.pm' ) =~ s|\b::\b|/|g; croak $@ if $@ !~ /^Can't locate $c in \@INC/ || not defined %{ $_ . '::' }; # <--- Zeile 30 } $r; }
1 2 3 4 5 6 7 8
#!/usr/bin/perl use strict; use warnings; our $test = 1; print $::test;
no strict 'refs'
1
2
3
4
5
6
7
8
9
10
t/11_load.................NOK 2/5
# Failed test 'Loading a missing class'
# at t/11_load.t line 13.
# ''
# doesn't match '(?-xism:^Can't locate)'
# Looks like you failed 1 test of 5.
t/11_load.................dubious
Test returned status 1 (wstat 256, 0x100)
DIED. FAILED test 2
Failed 1/5 tests, 80.00% okay
1 2 3
; my $c1 = 'c1' ; eval{ Class::Util::load $c1 } ; like $@, qr/^Can't locate/, 'Loading a missing class'
not defined %{ $_ . '::' }
1
2
3
4
5
6
# perl -MClass::Util -e 'Class::Util::load c1; print $@'
Can't locate c1.pm in @INC (@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5
/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local
lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/local/lib/perl5/site_perl
/usr/lib/perl5/site_perl .) at (eval 1) line 1.
6 Einträge, 1 Seite |