-
Notifications
You must be signed in to change notification settings - Fork 29
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
Output from predicates can be overwhelming with large buffers #106
Comments
I think having a cut off limit with an env variable should do the trick |
Putting my suggestion from the linked issue here too -- in the case of a large buffer, it may make sense to indent the whole thing slightly, so it stands out from the actual assertions. Something like:
While skimming through the output, it becomes easy to spot the error messages and differentiate them from the printed buffer. |
This is dependent on the library we use for the tree view because we don't know our indentation level. We use ptree also exists but seems a bit ... heavy weight I'm assuming we'd reach out to |
Before I forget, one downside of indenting everything, especially if the tree continues through that indentaton, is its a bit messier to take the output and copy/paste it somewhere. |
Perhaps you could output the tree as YAML? YAML has multiline strings, indentation, and is both user and machine readable. |
Its an interesting idea. The main problem is having a yaml generator that gives me control over formatting. Toml ones exist but its harder to find them for Yaml. For example, with foo:
bar:
- 1
- 2
- 3
word: |
Hello
World
How
Are
You Became ---
foo:
bar:
- 1
- 2
- 3
word: "Hello\nWorld\nHow\nAre\nYou" |
You're right, Rust's YAML support is lacking. If we do this, we'll likely have to do the encoding ourselves. |
See assert-rs/assert_cmd#121 for an example
The main question is how to resolve this in a way that is what people expect and works for them.
The text was updated successfully, but these errors were encountered: