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

Pretty print assertion failures in tests #79001

Closed
wants to merge 11 commits into from

Commits on Oct 20, 2021

  1. Add assertion details to panic info.

    The assertion details are added as a new enum field, allowing for future
    extensions with different information for other sources of panics.
    For example, `.unwrap()` could extend the enum to store a `&dyn Error`
    in the panic info.
    
    The panic handler in `std` passes the additional info unmodified to the
    panic hook.
    de-vri-es authored and jakoschiko committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    0df6e33 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0994b8a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d57b2da View commit details
    Browse the repository at this point in the history
  4. Mark panic::ExtraInfo as non-exhaustive.

    Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
    2 people authored and jakoschiko committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    9596fce View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7f8140e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5886466 View commit details
    Browse the repository at this point in the history
  7. Include macro name in pretty printed assertion.

    And use a comma to separate arguments of `assert_eq` and `assert_ne`.
    This has two advantages:
     * The printed text more closely matches the actual source code.
     * It avoids changing the meaning of $left == $right if $left or $right
       contain operators themselves.
    de-vri-es authored and jakoschiko committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    3ff9a91 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3b03d3a View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4b87907 View commit details
    Browse the repository at this point in the history
  10. Unify signatures of GetConsoleMode by changing HANDLE to c_void

    `GetConsoleMode` was declared twice with different signatures.
    The signatures have contained different definitions of `HANDLE`.
    jakoschiko committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    ec39e42 View commit details
    Browse the repository at this point in the history
  11. Bless test output

    jakoschiko committed Oct 20, 2021
    Configuration menu
    Copy the full SHA
    e0279b3 View commit details
    Browse the repository at this point in the history