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: improve assertion error inspection #28058

Closed

Commits on Jun 11, 2019

  1. assert: limit string inspection when logging assertion errors

    This makes sure long strings as `actual` or `expected` values on an
    `AssertionError` won't be logged completely. This is important as
    the actual value is somewhat redundant in combination with the error
    message which already logs the difference between the input values.
    BridgeAR committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    15f393c View commit details
    Browse the repository at this point in the history
  2. assert: fix error diff

    In some edge cases an identical line could be printed twice. This is
    now fixed by changing the algorithm a bit. It will now verify how
    many lines were identical before the current one.
    BridgeAR committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    fa7c39f View commit details
    Browse the repository at this point in the history
  3. assert: print more lines in the error diff

    So far consequitive identical lines were collapsed if there were at
    least three. Now they are only collapsed from five identical lines on.
    
    This also simplifies the implementation a tiny bit by abstracting some
    logic.
    BridgeAR committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    97ec3b2 View commit details
    Browse the repository at this point in the history