Skip to content

Decouple more tests from dart:io #255

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

Merged
merged 11 commits into from
Jul 23, 2025

Conversation

brianquinlan
Copy link
Contributor

@brianquinlan brianquinlan commented Jul 10, 2025

There should be no semantic changes to the tests. Instead of testing package:io_file against dart:io, the updated tests run each test case twice: once using dart:io for setup and verification and once using package:io_file for setup and verification.

Not all tests can be expressed using package:io_file (yet).


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@@ -21,14 +21,14 @@ void tests(FileUtils utils, FileSystem fs) {
late String cwd;

setUp(() {
tmp = createTemp('createDirectory');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's neat! I hadn't seen that package before.

I don't think that I can use it though because it depends on dart:io. The purpose of this TestUtils refactor is to (eventually) divorce the tests from dart:io completely so that you can verify fakes (where the file system objects will exist only in memory).

@brianquinlan brianquinlan marked this pull request as draft July 22, 2025 19:46
@brianquinlan brianquinlan changed the title Move all tests to use TestUtils Decouple more tests from dart:io Jul 22, 2025
@brianquinlan brianquinlan marked this pull request as ready for review July 23, 2025 00:16
@brianquinlan brianquinlan merged commit 7773819 into dart-lang:main Jul 23, 2025
140 of 148 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants