-
Notifications
You must be signed in to change notification settings - Fork 29.8k
use IOOverrides to allow inject file system, write test, find bug #40066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #40066 +/- ##
=========================================
+ Coverage 55.61% 58.11% +2.5%
=========================================
Files 194 194
Lines 18726 18784 +58
=========================================
+ Hits 10414 10917 +503
+ Misses 8312 7867 -445
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #40066 +/- ##
=========================================
Coverage ? 58.34%
=========================================
Files ? 194
Lines ? 18784
Branches ? 0
=========================================
Hits ? 10959
Misses ? 7825
Partials ? 0
Continue to review full report at Codecov.
|
| WebSocketException, | ||
| WebSocketTransformer; | ||
|
|
||
| /// An [IOOverrides] that can delegate to [FileSystem] implementation if provided. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is only used for testing. Should it go somewhere under test/src?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to test/src/io.dart
| AssetId('foobar', 'lib/main.dart'), | ||
| ])); | ||
| }, FlutterIOOverrides(fileSystem: fs)); | ||
| }), skip: Platform.isWindows); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give an example of the normalization that is expected, or how this fails on Windows? We should try to track this down to avoid similar problems later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment describing the issue
Description
This allows testing code that uses or otherwise requires
dart:io, like build_runner and Glob. I used this new feature to write a test, and promptly found a bug in an asset reader that I wrote.It looks like build_runner relies on an implementation in dart:io to normalize file paths, so this test doesn't currently work on windows.