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

Implement functions that checks the passed http status code value is in the expected range #306

Merged

Conversation

tetsuharuohzeki
Copy link
Collaborator

@tetsuharuohzeki tetsuharuohzeki commented Jul 17, 2024

This adds functions that checks the passed http status code value is in the expected range for HttpStatus.***

Names of each of functions are sorted with the spec. They uses is<Semantics><NumberRange> convention.

Test Strategy

We take an approach that is similar to property based testing.

The test case input values that satisfies a conditions (For http status code. It's very very simple condition).

And all test case files must check input patterns has no problem (no overlap, no missing spans) before running tests in them.

Related Issues

This requires #307

@tetsuharuohzeki tetsuharuohzeki added A-feature I-enhancement New feature or request labels Jul 17, 2024
@tetsuharuohzeki tetsuharuohzeki force-pushed the implement-status-check-functions branch 3 times, most recently from 4e589c5 to 0e08d21 Compare July 17, 2024 10:59
@tetsuharuohzeki tetsuharuohzeki marked this pull request as ready for review July 17, 2024 11:02
@arayaryoma arayaryoma added the R-semver/minor need to update minor version label Jul 25, 2024
…in the expected range

This adds functions that checks the passed http status code value is in the expected range for `HttpStatus.***`
Names of each of functions are sorted with the spec. They uses `is<Semantics><NumberRange>` convention.

- [`HttpStatus.isInformational1xx`](https://httpwg.org/specs/rfc9110.html#status.1xx)
- [`HttpStatus.isSuccessful2xx`](https://httpwg.org/specs/rfc9110.html#status.2xx)
- [`HttpStatus.isRedirection3xx`](https://httpwg.org/specs/rfc9110.html#status.3xx)
- [`HttpStatus.isClientError4xx`](https://httpwg.org/specs/rfc9110.html#status.4xx)
- [`HttpStatus.isServerError5xx`](https://httpwg.org/specs/rfc9110.html#status.5xx)

We take an approach for unit test that is similar to
[property based testing](https://en.wikipedia.org/wiki/Software_testing#Property_testing).
The test case input values that satisfies a conditions (For http status code. It's very very simple condition).
And all test case files must check input patterns has no problem (no overlap, no missing spans) before running tests in them.
@tetsuharuohzeki tetsuharuohzeki force-pushed the implement-status-check-functions branch from 0e08d21 to 59ae8cf Compare July 26, 2024 02:03
@tetsuharuohzeki tetsuharuohzeki merged commit 69fa56d into Nikkei:main Jul 26, 2024
3 checks passed
@tetsuharuohzeki tetsuharuohzeki deleted the implement-status-check-functions branch July 26, 2024 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-feature I-enhancement New feature or request R-semver/minor need to update minor version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants