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

assert: handle TokenTooLong error scenario #1559

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Commits on Mar 3, 2024

  1. 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
    arjunmahishi committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    7f5f3e3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f37ae55 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2024

  1. Configuration menu
    Copy the full SHA
    48a148a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f24d768 View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. 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).
    arjunmahishi committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    6b0dfad View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    594ac7d View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Configuration menu
    Copy the full SHA
    f341282 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2024

  1. 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.
    arjunmahishi committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    b83d206 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    9e31964 View commit details
    Browse the repository at this point in the history