Stream: beginners

Topic: Testing Effectful Functions


view this post on Zulip Simon Redding (Dec 12 2025 at 17:03):

Does anyone have any advice about how to write tests for effectful functions?

I'm exploring presenting lazy line by line text file access as walk/map/etc over a File.Reader (from basic-cli) but I'm struggling to write any useful tests for these functions which are, by necessity, effectful.

I keep running into "Effect in top-level" errors when I try to use "expect" and I hoping that there's a good way to avoid this or a different approach that I should be taking.

view this post on Zulip Richard Feldman (Dec 12 2025 at 17:10):

I have a design for this, but it's not currently the highest-priority thing to implement :sweat_smile:

view this post on Zulip Richard Feldman (Dec 12 2025 at 17:10):

short answer is that it's not implemented yet, sorry about that!

view this post on Zulip Simon Redding (Dec 12 2025 at 17:41):

That's good to know, and I can totally understand it not being a priority.
It's not a show stopper by any means.


Last updated: Dec 21 2025 at 12:15 UTC