-
-
Couldn't load subscription status.
- Fork 74
chore: fix bugs and add more tests #169
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
Open
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@techouse
techouse
changed the title
(削除) 🧪 add more tests (削除ここまで)
(追記) ✅ add more tests (追記ここまで)
Jul 23, 2025
@techouse
techouse
changed the title
(削除) ✅ add more tests (削除ここまで)
(追記) chore: add more tests (追記ここまで)
Jul 23, 2025
@CodingAleCR you could potentially merge these tests with the ones in #167
@techouse
techouse
changed the title
(削除) chore: add more tests (削除ここまで)
(追記) chore: fix bugs and add more tests (追記ここまで)
Jul 26, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
This pull request introduces significant updates to the
copyWithmethods forBaseRequest,StreamedRequest, and related classes, transitioning them to asynchronous operations. It also adds comprehensive test coverage for these changes, ensuring correctness and robustness. Below are the key changes grouped by theme:Enhancements to
copyWithMethods:copyWithmethod inBaseRequestwas updated to be asynchronous (Future<BaseRequest>), enabling support for asynchronous operations like handling streams. (lib/extensions/base_request.dart, [1] [2] [3]StreamedRequest.copyWithmethod was updated to be asynchronous and now usesawaitto handle streams properly. (lib/extensions/streamed_request.dart, lib/extensions/streamed_request.dartL8-R29)Bug Fixes and Improvements:
copyWithmethods forStreamedRequestandMultipartRequestincorrectly modified the original request's properties (e.g.,followRedirects,maxRedirects,persistentConnection). (test/extensions/multipart_request_test.dart, test/extensions/multipart_request_test.dartR1-R186)Updates to Intercepted Client:
_interceptRequestmethod inInterceptedClientto await the asynchronouscopyWithmethod, ensuring compatibility with the updatedBaseRequest. (lib/http/intercepted_client.dart, lib/http/intercepted_client.dartL400-R400)Comprehensive Test Coverage:
BaseRequest.copyWith,StreamedRequest.copyWith,MultipartRequest.copyWith, andIOStreamedResponse.copyWith, covering edge cases, property overrides, and unsupported types. (test/extensions/base_request_test.dart, [1];test/extensions/io_streamed_response_test.dart, [2];test/extensions/multipart_request_test.dart, [3]UnsupportedErroris thrown as expected. (test/extensions/base_request_test.dart, [1];test/extensions/base_reponse_test.dart, [2]Miscellaneous Changes:
dart:asyncanddart:convertin various files to support asynchronous operations and data encoding. (lib/extensions/base_request.dart, [1];test/extensions/base_reponse_test.dart, [2]These changes collectively modernize the
copyWithimplementation, making it more robust and suitable for handling complex request and response scenarios while ensuring backward compatibility through extensive testing.