-
Notifications
You must be signed in to change notification settings - Fork 219
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 some RestJson query string protocol request tests for servers #1040
Merged
JordonPhillips
merged 1 commit into
smithy-lang:main
from
david-perez:davidpz-fix-query-string-tests
Feb 21, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix some RestJson query string protocol request tests for servers
From a server perspective, `params` is the expected output after request deserialization. Since `queryParamsMapOfStringList` is bound with `@httpQueryParams` to the query string, its value must be present and derived from the input `queryParams` field of the request test.
- Loading branch information
commit 2d48d2eba83e461d9007d97545829800b81c495c
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test doesn't make sense from the server perspective anyway, since in IEEE 754 floating point numbers,
NaN != NaN
. As such, what should we assert we received after request deserialization, if we can't compare the deserialized value to anything? Shall I tag this test so that it only applies to the client, or should I assert something special in this case?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The behavior that nan isn't equal to nan is only important when you're using actual numbers for number things. Here we are asserting that the result is NaN instead of 0, +Inf, -Inf, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JordonPhillips I think what you're saying is that a protocol test involving
NaN
only cares that the deserialized value is aNaN
and that we shouldn't compare the bits, right? That's the approach we took https://docs.rs/aws-smithy-protocol-test/latest/aws_smithy_protocol_test/trait.FloatEquals.html, let me know if something else should be asserted.In any case, this is subtle and should be called out in the documentation, perhaps in this page? https://awslabs.github.io/smithy/1.0/spec/http-protocol-compliance-tests.html