summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/dist/Carp/t/broken_univ_can.t
blob: 0ec19d7aa318c89b6af4b00cc1d42d0642bf6e71 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# [perl #132910]
# This mock-up breaks Test::More.  Don’t use Test::More.

sub UNIVERSAL::can { die; }

# Carp depends on this to detect the override:
BEGIN { $UNIVERSAL::can::VERSION = 0xbaff1ed_bee; }

use Carp;

eval {
    sub { confess-sins }->(bless[], Foo);
};
print "1..1\n";
if ($@ !~ qr/^-sins at /) {
  print "not ok 1\n";
  print "# Expected -sins at blah blah blah...\n";
  print "# Instead, we got:\n";
  $@ =~ s/^/#   /mg;
  print $@;
}
else {
  print "ok 1\n";
}