File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -9,15 +9,16 @@ plan 1;
9
9
# ?DOES 1
10
10
{
11
11
# Test if file change events are not lost.
12
+ my constant RUNS = 10 ;
12
13
my $ watch-file = $ * SPEC . catfile( $ * TMPDIR , " watchme" );
13
14
my $ fh = $ watch-file . IO . open : : w, : 0 out-buffer;
14
15
my $ start-writing = Promise . new ;
15
16
my $ start-vow = $ start-writing . vow;
16
- my @ proceed = Promise . new xx 10 ;
17
+ my @ proceed = Promise . new xx RUNS ;
17
18
@ proceed [0 ]. keep ;
18
19
start {
19
20
await $ start-writing ;
20
- for ^ 10 {
21
+ for ^ RUNS {
21
22
await @ proceed [$ _ ];
22
23
$ fh . say : $ _ ;
23
24
$ fh . flush ;
@@ -30,7 +31,7 @@ plan 1;
30
31
whenever $ watch-file . IO . watch -> $ e {
31
32
$ count ++ ;
32
33
@ proceed [$ count ].? keep ;
33
- done if $ count == 10 ;
34
+ done if $ count == RUNS ;
34
35
}
35
36
whenever $ timeout {
36
37
done ;
@@ -39,7 +40,7 @@ plan 1;
39
40
}
40
41
41
42
if $ timeout . status ~~ Planned {
42
- is $ count , 10 , " all watch events received" ;
43
+ is $ count , RUNS , " all watch events received" ;
43
44
}
44
45
else {
45
46
flunk " timed out waiting for file change events" ;
You can’t perform that action at this time.
0 commit comments