Ancestors

Toot

Written by Ben Pfaff on 2024-09-03 at 16:50

I wish that the #rustlang assert_eq!() macro had a convention for whether the expected value should be first or second. I always have to go puzzle through the source code to figure out which argument was the wrong one.

=> More informations about this toot | More toots from blp@framapiaf.org

Descendants

Written by Bobulous :rust: :codeberg: on 2024-09-03 at 17:06

@blp Yeah, I always think that when I use it, then realise that under some usage scenarios there is no expected result, just two different values from two separate sources. So I see why they've left it flexible, but it can be a pain.

=> More informations about this toot | More toots from bobulous@fosstodon.org

Written by Ed Page on 2024-09-03 at 17:45

@blp Its annoying when making fancier asserts, like snapbox::assert_data_eq which shows a diff because we have to be prescriptive about it.

=> More informations about this toot | More toots from epage@hachyderm.io

Written by Ype Kingma on 2024-09-04 at 08:24

@blp

I normally use actual/expected order in assertions.

I wish someone could tell me how that grew on me. Maybe from my Java times?

Anyway, the fact that there is no convention is a nice example of minimal design.

=> More informations about this toot | More toots from KingmaYpe@mastodon.green

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113074649566677180
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
265.459144 milliseconds
Gemini-to-HTML Time
0.642105 milliseconds

This content has been proxied by September (ba2dc).