Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
8b139a8c
Unverified
Commit
8b139a8c
authored
Jan 10, 2020
by
Zachary Anderson
Committed by
GitHub
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tool] Use the delegate's toString in the ErrorHandlingFileSystem (#48597)
parent
67a68e9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
error_handling_file_system.dart
...lutter_tools/lib/src/base/error_handling_file_system.dart
+12
-0
error_handling_file_system_test.dart
...t/general.shard/base/error_handling_file_system_test.dart
+20
-0
No files found.
packages/flutter_tools/lib/src/base/error_handling_file_system.dart
View file @
8b139a8c
...
...
@@ -52,6 +52,9 @@ class ErrorHandlingFileSystem extends ForwardingFileSystem {
_cachedPath
=
null
;
delegate
.
currentDirectory
=
path
;
}
@override
String
toString
()
=>
delegate
.
toString
();
}
class
ErrorHandlingFile
...
...
@@ -141,6 +144,9 @@ class ErrorHandlingFile
);
}
@override
String
toString
()
=>
delegate
.
toString
();
Future
<
T
>
_run
<
T
>(
Future
<
T
>
Function
()
op
,
{
String
failureMessage
})
async
{
try
{
return
await
op
();
...
...
@@ -230,6 +236,9 @@ class ErrorHandlingDirectory
@override
Link
childLink
(
String
basename
)
=>
wrapLink
(
fileSystem
.
directory
(
delegate
).
childLink
(
basename
));
@override
String
toString
()
=>
delegate
.
toString
();
}
class
ErrorHandlingLink
...
...
@@ -254,4 +263,7 @@ class ErrorHandlingLink
@override
Link
wrapLink
(
io
.
Link
delegate
)
=>
ErrorHandlingLink
(
fileSystem
,
delegate
);
@override
String
toString
()
=>
delegate
.
toString
();
}
packages/flutter_tools/test/general.shard/base/error_handling_file_system_test.dart
View file @
8b139a8c
...
...
@@ -118,4 +118,24 @@ void main() {
expect
(
identical
(
firstPath
,
fs
.
path
),
false
);
});
group
(
'toString() gives toString() of delegate'
,
()
{
test
(
'ErrorHandlingFileSystem'
,
()
{
final
MockFileSystem
mockFileSystem
=
MockFileSystem
();
final
FileSystem
fs
=
ErrorHandlingFileSystem
(
mockFileSystem
);
expect
(
mockFileSystem
.
toString
(),
isNotNull
);
expect
(
fs
.
toString
(),
equals
(
mockFileSystem
.
toString
()));
});
test
(
'ErrorHandlingFile'
,
()
{
final
MockFileSystem
mockFileSystem
=
MockFileSystem
();
final
FileSystem
fs
=
ErrorHandlingFileSystem
(
mockFileSystem
);
final
MockFile
mockFile
=
MockFile
();
when
(
mockFileSystem
.
file
(
any
)).
thenReturn
(
mockFile
);
expect
(
mockFile
.
toString
(),
isNotNull
);
expect
(
fs
.
file
(
'file'
).
toString
(),
equals
(
mockFile
.
toString
()));
});
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment