File: err.t

package info (click to toggle)
libwant-perl 0.29-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 160 kB
  • sloc: perl: 171; makefile: 2
file content (23 lines) | stat: -rw-r--r-- 444 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
BEGIN { $| = 1; print "1..3\n"; }

# Test that we can load the module
END {print "not ok 1\n" unless $loaded;}
use Want;
$loaded = 1;
print "ok 1\n";

sub foo :lvalue {
    rreturn 23;
    return;
}

sub bar :lvalue {
    lnoreturn;
    return;
}

eval { foo() = 7 };
print ($@ =~ /Can't rreturn in lvalue context/ ? "ok 2\n" : "not ok 2\n");

eval { bar() };
print ($@ =~ /Can't lnoreturn except in ASSIGN context/ ? "ok 3\n" : "not ok 3\n");