File: 07_eval.t

package info (click to toggle)
libcoro-perl 6.570-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 1,144 kB
  • sloc: ansic: 2,560; perl: 2,122; makefile: 14
file content (32 lines) | stat: -rw-r--r-- 561 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
24
25
26
27
28
29
30
31
32
$|=1;
print "1..5\n";

use Coro;

async {
   my $t = eval "2";
   print "ok $t\n";
   cede;

   # a panic: restartop in this test can be caused by perl 5.8.8 not
   # properly handling constant folding (change 29976/28148)
   # (fixed in 5.10, 5.8.9)
   # we don't want to scare users, so disable it.
   delete $SIG{__DIE__} if $] < 5.008009;

   print defined eval "1/0" ? "not ok" : "ok", " 4\n";
};

async {
   my $t = eval "3";
   print "ok $t\n";
   cede;
   print defined eval "die" ? "not ok" : "ok", " 5\n";
};

print "ok 1\n";
cede;
cede;
cede;
cede;