Stream: contributing

Topic: ✔ tests for "roc format" with "dbg" expression


view this post on Zulip ptaszor (Dec 06 2023 at 02:29):

I've been trying to solve the issue #6188, but It seems there are no tests for formatting source files containing "dbg" (The only tests I've found for "roc format" are in "crates/compiler/test_syntax/tests/test_fmt.rs"). Is that really the case, and if so, should I write some?

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 03:00):

There are snapshot tests in crates/compiler/test_syntax/tests/snapshots/

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 03:01):

A passing dbg example is crates/compiler/test_syntax/tests/snapshots/pass/dbg.expr.formatted

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 03:02):

Which comes from formatting: crates/compiler/test_syntax/tests/snapshots/pass/dbg.expr.roc

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 03:02):

It looks like that may be the only example.

view this post on Zulip Brendan Hansknecht (Dec 06 2023 at 03:02):

And it is wrong based on the new standard

view this post on Zulip ptaszor (Dec 06 2023 at 03:09):

I see... I'll try to correct these, and maybe write some more

view this post on Zulip ptaszor (Dec 09 2023 at 18:56):

Should

dbg (1,
    2)

format to:

dbg
    (
        1,
        2,
    )

?

view this post on Zulip Richard Feldman (Dec 09 2023 at 19:03):

I could see this being nicer:

dbg (
    1,
    2,
)

view this post on Zulip ptaszor (Dec 09 2023 at 19:06):

Thanks. I'm working on my first commit, so this seems quite challenging, but I'll try to implement that.

view this post on Zulip ptaszor (Dec 10 2023 at 19:06):

I believe that I've done it. I made a pull request (#6241), though I'm afraid, I might have messed something up with theverification... 0.0 What should I do now?

view this post on Zulip Brendan Hansknecht (Dec 10 2023 at 19:14):

I kick off the test suite. Hopefully the tests pass and someone with more familiarity around formatting can give you a review.

view this post on Zulip ptaszor (Dec 10 2023 at 19:15):

Thanks!

view this post on Zulip Brendan Hansknecht (Dec 11 2023 at 04:03):

Realized the PR was super simple so just reviewed it myself.

view this post on Zulip Notification Bot (Dec 12 2023 at 13:54):

ptaszor has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC