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:
Peter von der Ahé 2018-01-17 14:17:54 +00:00 committed by Peter von der Ahé
parent 4e56b7a92b
commit e377e275ba

View file

@ -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;