Stream: beginners

Topic: expect funtionality


view this post on Zulip Artur Swiderski (Dec 02 2022 at 15:10):

I find it really horrible that when expect does fail it shows no additional output. Is this by design ?

view this post on Zulip Richard Feldman (Dec 02 2022 at 15:13):

ouch, I hope we haven't designed Roc to be really horrible :frown:

view this post on Zulip Richard Feldman (Dec 02 2022 at 15:14):

can you be more specific about what output you would have liked to see?

view this post on Zulip Anton (Dec 02 2022 at 15:24):

This may have occurred with a top-level expect?

view this post on Zulip Artur Swiderski (Dec 02 2022 at 15:26):

I created expect on top level. I see that it is failing but I can't see exact values which are not matching (obviously it would be helpful)

view this post on Zulip Anton (Dec 02 2022 at 15:31):

This is a bug

view this post on Zulip Anton (Dec 02 2022 at 15:35):

Using dbg should help you out for now @Artur Swiderski

view this post on Zulip Richard Feldman (Dec 02 2022 at 15:36):

does dbg work in roc test? I've never tried it, so it might not :big_smile:

view this post on Zulip Folkert de Vries (Dec 02 2022 at 15:39):

not reliably, I think

view this post on Zulip Artur Swiderski (Dec 02 2022 at 15:51):

thx I will try that

view this post on Zulip Artur Swiderski (Dec 02 2022 at 23:06):

how exactly I should use dbg in roc test what is the correct syntax ?

view this post on Zulip Luke Boswell (Dec 02 2022 at 23:30):

dbg is in the tutorial. Is there something more you are looking for? It would be good to add this to the tutorial for others too.

view this post on Zulip Luke Boswell (Dec 02 2022 at 23:33):

Basically I think you can give it any expression you like, like a string, and it will print it out etc when you roc dev your application.

view this post on Zulip Artur Swiderski (Dec 03 2022 at 14:26):

ok there is limitation to dbg , I see only first print even if I place more dbg checks one after another.
There is even bigger limitation .Whenever there are warnings in the app (which is normal during development) roc dev does not execute app and I cant see dbg. What left is to roc run to execute and in this mode dbg are invisible

view this post on Zulip Ayaz Hafiz (Dec 03 2022 at 14:54):

Thanks for the report. The first limitation is a known issue - it will be worked on.

The latter we have a PR for here: https://github.com/roc-lang/roc/pull/4661. It should land today, and then it will be in tomorrows nightly release of Roc


Last updated: Jul 06 2025 at 12:14 UTC