-
Notifications
You must be signed in to change notification settings - Fork 188
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
Protocol tests and floating point comparisons #1147
Comments
david-perez
added a commit
that referenced
this issue
Feb 10, 2022
The client protocol tests use the `aws_smithy_protocol_test::FloatEquals` for this [0]. Note we're only applying this to direct floating point shape members, i.e. this commit _does not_ address #1147. [0]: https://docs.rs/aws-smithy-protocol-test/latest/aws_smithy_protocol_test/trait.FloatEquals.html
david-perez
added a commit
that referenced
this issue
Feb 23, 2022
The client protocol tests use the `aws_smithy_protocol_test::FloatEquals` for this [0]. Note we're only applying this to direct floating point shape members, i.e. this commit _does not_ address #1147. [0]: https://docs.rs/aws-smithy-protocol-test/latest/aws_smithy_protocol_test/trait.FloatEquals.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Server protocol tests are using the
PartialEq
implementation on floating point types because theyassert_eq
on the containing operation input shape.Client protocol tests, on the other hand, always iterate over the shape's members and use
aws_smithy_protocol_test::FloatEquals
.I stumbled upon this earlier in smithy-lang/smithy#1040 (comment). I think this fix is fair.
However, I don't see this trait being used recursively in the client tests i.e. the shape containing floating point types could be nested.
https://github.com/awslabs/smithy-rs/blob/4b8381b22c8d4b8eebea60bdc6a666bb75dece57/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/generators/protocol/ProtocolTestGenerator.kt#L326-L335
The text was updated successfully, but these errors were encountered: