Skip to content

Commit db73915

Browse files
committed
More fixes for testing under windows
[email protected] Review URL: https://codereview.chromium.org/2393663002 .
1 parent f5ed63f commit db73915

File tree

4 files changed

+162
-131
lines changed

4 files changed

+162
-131
lines changed

pkg/analyzer/lib/file_system/memory_file_system.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ class MemoryResourceProvider implements ResourceProvider {
3636

3737
MemoryResourceProvider(
3838
{pathos.Context context, @deprecated bool isWindows: false})
39-
: _pathContext = context ?? pathos.context,
40-
absolutePathContext = new AbsolutePathContext(
41-
pathos.Style.platform == pathos.Style.windows);
39+
: _pathContext = (context ??= pathos.context),
40+
absolutePathContext =
41+
new AbsolutePathContext(context.style == pathos.Style.windows);
4242

4343
@override
4444
pathos.Context get pathContext => _pathContext;
@@ -416,10 +416,6 @@ class _MemoryFile extends _MemoryResource implements File {
416416
@override
417417
File resolveSymbolicLinksSync() => this;
418418

419-
@override
420-
Uri toUri() =>
421-
new Uri.file(path, windows: _provider.pathContext == pathos.windows);
422-
423419
@override
424420
void writeAsBytesSync(List<int> bytes) {
425421
_provider._setFileContent(this, bytes);
@@ -513,10 +509,6 @@ class _MemoryFolder extends _MemoryResource implements Folder {
513509

514510
@override
515511
Folder resolveSymbolicLinksSync() => this;
516-
517-
@override
518-
Uri toUri() =>
519-
new Uri.directory(path, windows: _provider.pathContext == pathos.windows);
520512
}
521513

522514
/**
@@ -570,4 +562,7 @@ abstract class _MemoryResource implements Resource {
570562

571563
@override
572564
String toString() => path;
565+
566+
@override
567+
Uri toUri() => _provider.pathContext.toUri(path);
573568
}

0 commit comments

Comments
 (0)