mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[testing] Fix path relativization on Windows
Change-Id: Ie685fb3cebf9e9c638c1e82b0f88d1c540c86a98 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143810 Reviewed-by: Jens Johansen <jensj@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
parent
d690a0c7c4
commit
5a80fb6090
|
@ -137,8 +137,8 @@ class AnalyzerDiagnostic {
|
|||
return kind == null
|
||||
? "Malformed output from dartanalyzer:\n$message"
|
||||
: "${uri.toFilePath()}:$line:$startColumn: "
|
||||
"${kind == 'INFO' ? 'warning: hint' : kind.toLowerCase()}:\n"
|
||||
"[$code] $message";
|
||||
"${kind == 'INFO' ? 'warning: hint' : kind.toLowerCase()}:\n"
|
||||
"[$code] $message";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -169,10 +169,18 @@ Future<Null> analyzeUris(
|
|||
} catch (e) {
|
||||
topLevel = Uri.base.toFilePath(windows: false);
|
||||
}
|
||||
if (Platform.isWindows) {
|
||||
// We need lowercase comparison on Windows to match C:/path with c:/path
|
||||
topLevel = topLevel.toLowerCase();
|
||||
}
|
||||
|
||||
String toFilePath(Uri uri) {
|
||||
String path = uri.toFilePath(windows: false);
|
||||
return path.startsWith(topLevel) ? path.substring(topLevel.length) : path;
|
||||
return (Platform.isWindows
|
||||
? path.toLowerCase().startsWith(topLevel)
|
||||
: path.startsWith(topLevel))
|
||||
? path.substring(topLevel.length)
|
||||
: path;
|
||||
}
|
||||
|
||||
Set<String> filesToAnalyze = new Set<String>();
|
||||
|
|
Loading…
Reference in a new issue