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

Support debug-compact serializer? #533

Closed
tisonkun opened this issue Jul 24, 2024 · 2 comments
Closed

Support debug-compact serializer? #533

tisonkun opened this issue Jul 24, 2024 · 2 comments

Comments

@tisonkun
Copy link
Contributor

We now have assert_debug_snapshot which uses "{:#?}" a.k.a. pretty print.

I wonder if it's reasonable to add a assert_compact_debug_snapshot use "{:?}" so that we may save some lines.

@tisonkun
Copy link
Contributor Author

Currently, it's a bit wordy:

    assert_debug_snapshot!(
        candidates,
        @r###"
        [
            0,
        ]
        "###
    );

using ron reduce two spaces in the indent, but doesn't help too much.

assert_ron_snapshot!(
        candidates,
        @r###"
        [
          0,
        ]
        "###
    );

Of course, I can use assert_snapshot!(format!("{candidates:?}"), @r"[0]");, but it seems insta try to provide convenient serializer out of the box.

@max-sixty
Copy link
Collaborator

Waiting on review in #514 !

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

2 participants