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
assert: handle TokenTooLong error scenario #1559
Open
arjunmahishi
wants to merge
9
commits into
stretchr:master
Choose a base branch
from
arjunmahishi:scan-max-tokens
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Commits on Mar 3, 2024
-
assert: handle TokenTooLong error scenario while formatting assertion…
… messages As pointed out in stretchr#1525, when the assertion message is too long, it gets completely truncated in the final output. This is because, `bufio.Scanner.Scan()` has a default `MaxScanTokenSize` set to `65536` characters (64 * 1024). The `Scan()` function return false whenever the line being scanned exceeds that max limit. This leads to the final assertion message being truncated. This commit fixes that by manually setting the internal scan buffer size to `len(message) + 1` to make sure that above scenario never occurs. Fixes stretchr#1525
Configuration menu - View commit details
-
Copy full SHA for 7f5f3e3 - Browse repository at this point
Copy the full SHA 7f5f3e3View commit details -
Configuration menu - View commit details
-
Copy full SHA for f37ae55 - Browse repository at this point
Copy the full SHA f37ae55View commit details
Commits on Mar 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 48a148a - Browse repository at this point
Copy the full SHA 48a148aView commit details -
Configuration menu - View commit details
-
Copy full SHA for f24d768 - Browse repository at this point
Copy the full SHA f24d768View commit details
Commits on Mar 6, 2024
-
assert: make Test_indentMessageLines more deterministic
Instead of using an arbitrary value like 20000, we can just use the value defined by bufio package (MaxScanTokenSize).
Configuration menu - View commit details
-
Copy full SHA for 6b0dfad - Browse repository at this point
Copy the full SHA 6b0dfadView commit details
Commits on Mar 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 594ac7d - Browse repository at this point
Copy the full SHA 594ac7dView commit details
Commits on Mar 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f341282 - Browse repository at this point
Copy the full SHA f341282View commit details
Commits on Mar 21, 2024
-
assert: pre-compute the indent spaces in indentMessageLines
Also, fix the test cases for this function. This commit generates the input based on parameters like bytes per line and number of lines. The assertion is made against the pattern of the output rather than the exact output.
Configuration menu - View commit details
-
Copy full SHA for b83d206 - Browse repository at this point
Copy the full SHA b83d206View commit details
Commits on Apr 4, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 9e31964 - Browse repository at this point
Copy the full SHA 9e31964View commit details
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.