You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
The tests currently do not check negative inputs, and would not detect if the library is buggy by accepting too much, e.g. basically never throwing an error. This is because doing so is not really feasible: The "obvious" way to test error scenarios is to assert that the returned error equals some expected error. However, that cannot work, because ErrorKind implements neither Debug nor PartialEq.
Implementing PartialEq is impossible however, because of ParsingFailed { … dyn StdError } and IoError(std::io::Error). Note that [std::io::ErrorKind](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#impl-PartialEq-for-ErrorKind) and [std::num::IntErrorKind](https://doc.rust-lang.org/std/num/enum.IntErrorKind.html#impl-PartialEq-for-IntErrorKind) already implement PartialEq.
I have no good idea how to approach this, only bad ones:
Alternate enum: A new method fn ErrorKind::to_pure(&self) -> PureErrorKind;, which converts the current ErrorKind to a dataless enum PureErrorKind which has PartialEq.
Hardcode the error message in the tests: I hate it. It would work though.
Somehow moving the data to Error, making it easy for the current ErrorKind to implement PartialEq.
The tests currently do not check negative inputs, and would not detect if the library is buggy by accepting too much, e.g. basically never throwing an error. This is because doing so is not really feasible: The "obvious" way to test error scenarios is to assert that the returned error equals some expected error. However, that cannot work, because
ErrorKindimplements neitherDebugnorPartialEq.Implementing
Debugis an easy fix:Implementing
PartialEqis impossible however, because ofParsingFailed { … dyn StdError }andIoError(std::io::Error). Note that[std::io::ErrorKind](https://doc.rust-lang.org/std/io/enum.ErrorKind.html#impl-PartialEq-for-ErrorKind)and[std::num::IntErrorKind](https://doc.rust-lang.org/std/num/enum.IntErrorKind.html#impl-PartialEq-for-IntErrorKind)already implementPartialEq.I have no good idea how to approach this, only bad ones:
fn ErrorKind::to_pure(&self) -> PureErrorKind;, which converts the currentErrorKindto a datalessenum PureErrorKindwhich has PartialEq.Error, making it easy for the current ErrorKind to implementPartialEq.