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

Increase or remove ensure Debug output limit #406

Open
sirewix opened this issue Feb 14, 2025 · 0 comments
Open

Increase or remove ensure Debug output limit #406

sirewix opened this issue Feb 14, 2025 · 0 comments

Comments

@sirewix
Copy link

sirewix commented Feb 14, 2025

Currently the limit is set to 40 bytes in #195, there are few issues with that:

  1. Unpredictability. I discovered this trying to figure out why in some cases I don't get useful information during test failures, while in other cases I do. This is inconsistent

  2. 40 bytes is only useful when comparing numbers, for real use cases that will very often be not enough. Something like 400 bytes would suffice I guess

  3. The initial argument

    This avoids dumping enormous objects into the error message implicitly.

    Does not make that much sense:

    • assert_eq doesn't have that limitation
    • ensure is used primarily in tests, having a bit of a spill there wouldn't hurt, while not getting useful information actually might hurt

    So I wonder if this limit can be completely removed.

    On the contrary, the difference with assert_eq is that with ensure the memory needs to be allocated, while with assert_eq it probably prints right away, so some limit probably makes sense for this reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant