13 local $SIG{__WARN__}= sub { push @warns, $_[0] };
16 eval "require; 1" or $error = $@;
17 ok(1, "Check that eval 'require' does not segv");
18 ok(0 == @warns, "We expect the eval to die, without producing warnings");
19 like($error, qr/Missing or undefined argument to require/, "Make sure we got the error we expect");
24 sub TIESCALAR{bless[]}
29 eval 'require $x; 1' or $error = $@;
31 'no warnings from require $tied_undef_after_str_assignment');
32 like($error, qr/^Missing or undefined argument to require/,
33 "Make sure we got the error we expect");
39 eval 'require $x; 1' or $error = $@;
41 'no warnings from require $tied_undef_after_num_assignment');
42 like($error, qr/^Missing or undefined argument to require/,
43 "Make sure we got the error we expect");
48 *CORE::GLOBAL::require = *CORE::GLOBAL::require = sub { };
49 eval "require; 1" or $error = $@;
50 ok(1, "Check that eval 'require' on overloaded require does not segv");
51 ok(0 == @warns, "We expect the eval to die, without producing warnings");
53 # NOTE! The following test does NOT represent a commitment or promise that the following logic is
54 # the *right* thing to do. It may well not be. But this is how it works now, and we want to test it.
55 # IOW, do not use this test as the basis to argue that this is how it SHOULD work. Thanks, yves.
56 ok(!defined($error), "We do not expect the overloaded version of require to die from no arguments");