mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Work around diff missing on Windows
Change-Id: I5b1e5ce7334d56ac93613a60b958e2a66fe6d602 Reviewed-on: https://dart-review.googlesource.com/35281 Reviewed-by: Peter von der Ahé <ahe@google.com> Commit-Queue: Peter von der Ahé <ahe@google.com>
This commit is contained in:
parent
4e56b7a92b
commit
e377e275ba
|
@ -9,7 +9,7 @@ library fasta.testing.kernel_chain;
|
|||
|
||||
import 'dart:async' show Future;
|
||||
|
||||
import 'dart:io' show Directory, File, IOSink;
|
||||
import 'dart:io' show Directory, File, IOSink, Platform;
|
||||
|
||||
import 'dart:typed_data' show Uint8List;
|
||||
|
||||
|
@ -275,7 +275,17 @@ class BytesCollector implements Sink<List<int>> {
|
|||
}
|
||||
|
||||
Future<String> runDiff(Uri expected, String actual) async {
|
||||
// TODO(ahe): Implement this for Windows.
|
||||
if (Platform.isWindows) {
|
||||
// TODO(ahe): Implement this for Windows.
|
||||
return """
|
||||
==> Expected ($expected) <==
|
||||
${new File.fromUri(expected).readAsStringSync()}
|
||||
|
||||
==> Actual <==
|
||||
$actual
|
||||
|
||||
""";
|
||||
}
|
||||
StdioProcess process = await StdioProcess
|
||||
.run("diff", <String>["-u", expected.toFilePath(), "-"], input: actual);
|
||||
return process.output;
|
||||
|
|
Loading…
Reference in a new issue