File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ import 'package:webdev/src/util.dart';
14
14
15
15
import 'test_utils.dart' ;
16
16
17
+ /// Key: name of file in web directory
18
+ /// Value: `null` - exists in both modes
19
+ /// `true` - DDC only
20
+ /// `false` - dart2js only
21
+ const _testItems = const < String , bool > {
22
+ 'main.dart.js' : null ,
23
+ 'main.dart.bootstrap.js' : true ,
24
+ 'main.ddc.js' : true
25
+ };
26
+
17
27
void main () {
18
28
String exampleDirectory;
19
29
setUpAll (() async {
@@ -47,13 +57,13 @@ void main() {
47
57
await checkProcessStdout (process, expectedItems);
48
58
await process.shouldExit (0 );
49
59
50
- await d.file ('main.dart.js' , isNotEmpty).validate ();
60
+ for (var entry in _testItems.entries) {
61
+ var shouldExist = (entry.value ?? withDDC) == withDDC;
51
62
52
- for (var ddcFile in ['main.dart.bootstrap.js' , 'main.ddc.js' ]) {
53
- if (withDDC) {
54
- await d.file (ddcFile, isNotEmpty).validate ();
63
+ if (shouldExist) {
64
+ await d.file (entry.key, isNotEmpty).validate ();
55
65
} else {
56
- await d.nothing (ddcFile ).validate ();
66
+ await d.nothing (entry.key ).validate ();
57
67
}
58
68
}
59
69
});
You can’t perform that action at this time.
0 commit comments