OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:convert'; | 6 import 'dart:convert'; |
7 import 'dart:io'; | 7 import 'dart:io'; |
8 | 8 |
9 import 'package:path/path.dart' as path; | 9 import 'package:path/path.dart' as path; |
10 import 'package:async_helper/async_helper.dart'; | 10 import 'package:async_helper/async_helper.dart'; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 process.stdin.writeln('--out="$outFile" "$inFile"'); | 67 process.stdin.writeln('--out="$outFile" "$inFile"'); |
68 process.stdin.writeln('--out="$outFile2" "$inFile"'); | 68 process.stdin.writeln('--out="$outFile2" "$inFile"'); |
69 process.stdin.writeln('too many arguments'); | 69 process.stdin.writeln('too many arguments'); |
70 process.stdin.writeln(r'"non existing file.dart"'); | 70 process.stdin.writeln(r'"non existing file.dart"'); |
71 process.stdin.close(); | 71 process.stdin.close(); |
72 Future<String> output = process.stdout.transform(UTF8.decoder).join(); | 72 Future<String> output = process.stdout.transform(UTF8.decoder).join(); |
73 Future<String> errorOut = process.stderr.transform(UTF8.decoder).join(); | 73 Future<String> errorOut = process.stderr.transform(UTF8.decoder).join(); |
74 return Future.wait([output, errorOut]) | 74 return Future.wait([output, errorOut]) |
75 .then((result) { | 75 .then((result) { |
76 String stdoutOutput = result[0]; | 76 String stdoutOutput = result[0]; |
77 print('out:\n$stdoutOutput'); | |
78 String stderrOutput = result[1]; | 77 String stderrOutput = result[1]; |
79 print('err:\n$stderrOutput'); | |
80 | 78 |
81 Expect.equals(4, ">>> EOF STDERR".allMatches(stderrOutput).length); | 79 Expect.equals(4, ">>> EOF STDERR".allMatches(stderrOutput).length); |
82 Expect.equals(4, ">>>".allMatches(stderrOutput).length); | 80 Expect.equals(4, ">>>".allMatches(stderrOutput).length); |
83 | 81 |
84 Expect.equals(2, ">>> TEST OK".allMatches(stdoutOutput).length); | 82 Expect.equals(2, ">>> TEST OK".allMatches(stdoutOutput).length); |
85 Expect.equals(2, ">>> TEST FAIL".allMatches(stdoutOutput).length); | 83 Expect.equals(2, ">>> TEST FAIL".allMatches(stdoutOutput).length); |
86 Expect.equals(4, ">>>".allMatches(stdoutOutput).length); | 84 Expect.equals(4, ">>>".allMatches(stdoutOutput).length); |
87 }); | 85 }); |
88 } | 86 } |
89 | 87 |
90 void main() { | 88 void main() { |
91 var tmpDir; | 89 var tmpDir; |
92 asyncTest(() { | 90 asyncTest(() { |
93 return setup() | 91 return setup() |
94 .then(launchDart2Js) | 92 .then(launchDart2Js) |
95 .then(runTests) | 93 .then(runTests) |
96 .whenComplete(cleanUp); | 94 .whenComplete(cleanUp); |
97 }); | 95 }); |
98 } | 96 } |
OLD | NEW |