Skip to content
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

Fix CommandArgumentEnumerator behavior for .NET 8 #544

Conversation

thomaslevesque
Copy link
Contributor

Fixes #541

There's been a breaking change in .NET 8. The behavior for IEnumerator.Current, which has always been undefined when called after MoveNext() returned false, has changed from "return the last value" to "throw an exception". So instead of calling _enumerator.Current every time Current is invoked, we now store the value of _enumerator.Current after _enumerator.MoveNext() returned true.

I also added the net8.0 TFM to the unit tests to validate the behavior is now correct on .NET 8.

Copy link

codecov bot commented Dec 31, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0726df9) 82.34% compared to head (5b1d19f) 77.86%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #544      +/-   ##
==========================================
- Coverage   82.34%   77.86%   -4.49%     
==========================================
  Files         105      105              
  Lines        3308     3311       +3     
  Branches        0      717     +717     
==========================================
- Hits         2724     2578     -146     
+ Misses        584      580       -4     
- Partials        0      153     +153     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thomaslevesque
Copy link
Contributor Author

Closing in favor of #542

@thomaslevesque thomaslevesque deleted the fix-command-argument-enumerator branch January 1, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant