summaryrefslogtreecommitdiff
path: root/t/op/yadayada.t
blob: deca46c789112748a94200456476ac20faa4d80e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!./perl

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib';
    require './test.pl';
}

use strict;

plan 5;

my $err = "Unimplemented at $0 line " . ( __LINE__ + 2 ) . ".\n";

eval { ... };

is $@, $err;

$err = "foo at $0 line " . ( __LINE__ + 2 ) . ".\n";

eval { !!! "foo" };

is $@, $err;

$err = "Died at $0 line " . ( __LINE__ + 2 ) . ".\n";

eval { !!! };

is $@, $err;

my $warning;

local $SIG{__WARN__} = sub { $warning = shift };

$err = "bar at $0 line " . ( __LINE__ + 2 ) . ".\n";

eval { ??? "bar" };

is $warning, $err;

$err = "Warning: something's wrong at $0 line " . ( __LINE__ + 2 ) . ".\n";

eval { ??? };

is $warning, $err;