Stream: beginners

Topic: Test expectations


view this post on Zulip Sebastian Porto (Dec 14 2022 at 10:53):

Hi, re https://www.roc-lang.org/tutorial#tests-and-expectations

Is this the only form of test expectations supported at the moment?
e.g.

expect someFunction 123 == 1

With this, all I get is This expectation failed but it doesn't tell me the actual value returned by the function.

view this post on Zulip Luke Boswell (Dec 14 2022 at 11:12):

It will print the value of variables inside the expect. here is an example from my AoC code. Sorry I can't give a better example, on my phone.

view this post on Zulip Sebastian Porto (Dec 14 2022 at 11:18):

Oh nice, that definitelly belongs in the tutorial

view this post on Zulip Richard Feldman (Dec 14 2022 at 12:06):

good point!

view this post on Zulip Richard Feldman (Dec 14 2022 at 12:07):

In the future I'd also like to get it to print out various more intermediate values that aren't named, but there are some design questions there regarding where to draw the line so the output doesn't get overwhelming

view this post on Zulip Anton (Dec 14 2022 at 12:22):

I'll update the tutorial


Last updated: Jul 05 2025 at 12:14 UTC