This repository was archived by the owner on Aug 28, 2024. It is now read-only.
File tree 4 files changed +36
-34
lines changed 4 files changed +36
-34
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,8 @@ void main() {
86
86
final Map <String , dynamic > isolateCoverage =
87
87
_getScriptCoverage (coverage, 'test_app_isolate.dart' );
88
88
hits = isolateCoverage['hits' ];
89
- _expectHitCount (hits, 9 , 1 );
90
- _expectHitCount (hits, 16 , 1 );
89
+ _expectHitCount (hits, 11 , 1 );
90
+ _expectHitCount (hits, 18 , 1 );
91
91
});
92
92
}
93
93
Original file line number Diff line number Diff line change @@ -57,31 +57,31 @@ void main() {
57
57
58
58
final Map <int , int > isolateFile = hitMap[_isolateLibFileUri];
59
59
final Map <int , int > expectedHits = {
60
- 10 : 1 ,
61
- 11 : 1 ,
62
- 13 : 0 ,
63
- 17 : 1 ,
64
- 18 : 1 ,
65
- 20 : 0 ,
66
- 27 : 1 ,
60
+ 12 : 1 ,
61
+ 13 : 1 ,
62
+ 15 : 0 ,
63
+ 19 : 1 ,
64
+ 20 : 1 ,
65
+ 22 : 0 ,
67
66
29 : 1 ,
68
- 30 : 2 ,
69
67
31 : 1 ,
70
- 32 : 3 ,
68
+ 32 : 2 ,
71
69
33 : 1 ,
70
+ 34 : 3 ,
71
+ 35 : 1 ,
72
72
};
73
73
if (Platform .version.startsWith ('1.' )) {
74
74
// Dart VMs prior to 2.0.0-dev.5.0 contain a bug that emits coverage on the
75
75
// closing brace of async function blocks.
76
76
// See: https://github.com/dart-lang/coverage/issues/196
77
- expectedHits[21 ] = 0 ;
77
+ expectedHits[23 ] = 0 ;
78
78
} else {
79
79
// Dart VMs version 2.0.0-dev.6.0 mark the opening brace of a function as
80
80
// coverable.
81
- expectedHits[9 ] = 1 ;
82
- expectedHits[16 ] = 1 ;
83
- expectedHits[26 ] = 1 ;
84
- expectedHits[30 ] = 3 ;
81
+ expectedHits[11 ] = 1 ;
82
+ expectedHits[18 ] = 1 ;
83
+ expectedHits[28 ] = 1 ;
84
+ expectedHits[32 ] = 3 ;
85
85
}
86
86
expect (isolateFile, expectedHits);
87
87
});
Original file line number Diff line number Diff line change @@ -45,31 +45,31 @@ void main() {
45
45
46
46
final Map <int , int > isolateFile = hitMap[_isolateLibFileUri];
47
47
final Map <int , int > expectedHits = {
48
- 10 : 1 ,
49
- 11 : 1 ,
50
- 13 : 0 ,
51
- 17 : 1 ,
52
- 18 : 1 ,
53
- 20 : 0 ,
54
- 27 : 1 ,
48
+ 12 : 1 ,
49
+ 13 : 1 ,
50
+ 15 : 0 ,
51
+ 19 : 1 ,
52
+ 20 : 1 ,
53
+ 22 : 0 ,
55
54
29 : 1 ,
56
- 30 : 2 ,
57
55
31 : 1 ,
58
- 32 : 3 ,
56
+ 32 : 2 ,
59
57
33 : 1 ,
58
+ 34 : 3 ,
59
+ 35 : 1 ,
60
60
};
61
61
// Dart VMs prior to 2.0.0-dev.5.0 contain a bug that emits coverage on the
62
62
// closing brace of async function blocks.
63
63
// See: https://github.com/dart-lang/coverage/issues/196
64
64
if (Platform .version.startsWith ('1.' )) {
65
- expectedHits[21 ] = 0 ;
65
+ expectedHits[23 ] = 0 ;
66
66
} else {
67
67
// Dart VMs version 2.0.0-dev.6.0 mark the opening brace of a function as
68
68
// coverable.
69
- expectedHits[9 ] = 1 ;
70
- expectedHits[16 ] = 1 ;
71
- expectedHits[26 ] = 1 ;
72
- expectedHits[30 ] = 3 ;
69
+ expectedHits[11 ] = 1 ;
70
+ expectedHits[18 ] = 1 ;
71
+ expectedHits[28 ] = 1 ;
72
+ expectedHits[32 ] = 3 ;
73
73
}
74
74
expect (isolateFile, expectedHits);
75
75
});
Original file line number Diff line number Diff line change @@ -6,15 +6,17 @@ import 'dart:async';
6
6
import 'dart:io' ;
7
7
import 'dart:isolate' ;
8
8
9
+ const int answer = 42 ;
10
+
9
11
String fooSync (int x) {
10
- if (x == 42 ) {
12
+ if (x == answer ) {
11
13
return '*' * x;
12
14
}
13
15
return List .generate (x, (_) => 'xyzzy' ).join (' ' );
14
16
}
15
17
16
18
Future <String > fooAsync (int x) async {
17
- if (x == 42 ) {
19
+ if (x == answer ) {
18
20
return '*' * x;
19
21
}
20
22
return List .generate (x, (_) => 'xyzzy' ).join (' ' );
@@ -26,8 +28,8 @@ Future<String> fooAsync(int x) async {
26
28
void isolateTask (dynamic threeThings) {
27
29
sleep (const Duration (milliseconds: 500 ));
28
30
29
- fooSync (42 );
30
- fooAsync (42 ).then ((_) {
31
+ fooSync (answer );
32
+ fooAsync (answer ).then ((_) {
31
33
final SendPort port = threeThings.first;
32
34
final int sum = threeThings[1 ] + threeThings[2 ];
33
35
port.send (sum);
You can’t perform that action at this time.
0 commit comments