Commit | Line | Data |
---|---|---|
8f3964af | 1 | #!perl -w |
2 | ||
3 | # We assume that TestInit has been used. | |
4 | ||
5 | BEGIN { | |
6 | require './test.pl'; | |
7 | } | |
8 | ||
9 | use strict; | |
10 | ||
11 | plan tests => 4; | |
12 | ||
13 | watchdog(10); | |
14 | ||
15 | $SIG{ALRM} = sub { | |
16 | die "Alarm!\n"; | |
17 | }; | |
18 | ||
19 | pass('before the first loop'); | |
20 | ||
21 | alarm 2; | |
22 | ||
23 | eval { | |
24 | 1 while 1; | |
25 | }; | |
26 | ||
27 | is($@, "Alarm!\n", 'after the first loop'); | |
28 | ||
29 | pass('before the second loop'); | |
30 | ||
31 | alarm 2; | |
32 | ||
33 | eval { | |
34 | while (1) { | |
35 | } | |
36 | }; | |
37 | ||
38 | is($@, "Alarm!\n", 'after the second loop'); |