Repository navigation
Test number, curlConfig and isValidInstallId directly - #8
Open
dmccoystephenson wants to merge 1 commit into
Open
dmccoystephenson wants to merge 1 commit into
dmccoystephenson wants to merge 1 commit into
Conversation
number is checked for shortest output, a JSON-grammar round trip over edge values, and independence from the program's global locale. curlConfig is pinned line for line, so a change to the options curl is given shows up as a test failure. isValidInstallId is checked at its length bounds and against characters outside [A-Za-z0-9_.-]. DBL_MAX is left out of the number test: it is written as 2e+308, which overflows (#7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (posted as a plain comment; the review below was performed inline in the same session that wrote the change, so it is not an independent review):
Judgment notes:
This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Stage B (unit-test expansion): three
trace_client::detailhelpers that had no direct test are now tested directly. Onlytest/test_trace_client.cppis changed;trace_client.hppis not touched.numberIsTheShortestJsonDecimalThatReadsBack: checks exact output for0.1,-3,1.5and0.1 + 0.2. For edge values (-0.0,1e21,1e-7,5e-324,1.7e308,2^53 + 1, …), checks that every output matches JSON number grammar and reads back unchanged throughstrtod. Also checks that a global locale with a decimal comma and thousands grouping never reaches the body.curlConfigFixesEveryOptionAndQuotesEveryValue: pins the full curl config line for line (url,proto = "=http,https", the four headers,user-agentwithTRACE_CLIENT_VERSION,data-binary,max-time/connect-timeoutof 5,output,write-out). Any change to what curl is told now fails a test. The test also checks that a quote in the key is escaped and a newline in the application is dropped from theUser-Agent. It is guarded the same way ascurlConfigitself, with theNUL//dev/nullsplit for_WIN32.isValidInstallIdAcceptsOnlyTheDocumentedCharacters: checks the 1..255 length bounds, the[A-Za-z0-9_.-]alphabet, and whitespace, path, quote, newline, NUL and non-ASCII bytes.All three are registered in
main()'stests[].Bug found (not fixed here)
While the
numbertest was being written, a round trip ofDBL_MAXfailed:number(DBL_MAX)returns2e+308, which overflows to infinity. A Stage B cycle does not change production code, so the bug was filed as #7, with the cause and a one-line suggested fix.DBL_MAXis left out of the value list, with a comment naming #7.Test plan
make test(g++, C++11,-Werror):44 tests, 0 failed checks(41 before, +3)make test STD=c++17:44 tests, 0 failed checksmake test STD=c++2a(the local g++ predates thec++20spelling):44 tests, 0 failed checksDeferred issues
TRACE_CLIENT_CURLignored on Windows): skipped, because the issue asks the owner to choose between honoring the override and documenting the current behavior.No tracking issue for the tests: the gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson