From eab5cd9853c13ec2207977d9b9ef7b6750fe0817 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 30 Aug 2018 14:47:04 -0700 Subject: [PATCH] Fix analysis shard of dev/bots/test.dart so it works on Windows. (#21203) Normalize file path to non-Windows so string path comparison works. --- dev/bots/analyze.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index c0296c54cc..549787b2b8 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -249,7 +249,8 @@ Future _verifyNoTestPackageImports(String workingDirectory) async { }) .map((FileSystemEntity entity) { final File file = entity; - final String name = path.relative(file.path, from: workingDirectory); + final String name = Uri.file(path.relative(file.path, + from: workingDirectory)).toFilePath(windows: false); if (name.startsWith('bin/cache') || name == 'dev/bots/test.dart' || name.startsWith('.pub-cache')) @@ -266,7 +267,7 @@ Future _verifyNoTestPackageImports(String workingDirectory) async { return ' $name: Shim seems to be missing the expected import/export lines.'; } final int count = 'package:test'.allMatches(data).length; - if (file.path.contains('/test_driver/') || + if (path.split(file.path).contains('test_driver') || name.startsWith('dev/missing_dependency_tests/') || name.startsWith('dev/automated_tests/') || name.startsWith('packages/flutter/test/engine/') ||