{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreih5dzmeztpvfcvbzs4esl343ihif676lf4umu64slc6un3ld3hjqu",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mideudy7on72"
},
"path": "/t/change-error-message-of-a-failing-assert-eq/24118#post_9",
"publishedAt": "2026-03-30T15:59:41.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "mathstuf:\n\n> I tend to do `actual, expected` because `actual` is usually just a variable reference while `expected` can be a large literal or other more verbose expression and the last argument is far more amenable to reformat splay than the former (IMO).\n\njUnit and related use the _opposite_ order for a similar reason: they're assuming that `expected` is often a small literal, and `actual` is often a function call with a bunch of parameters (the call that's being tested). This is also the documented convention used in googletest for other languages, though apparently not the Rust port as mentioned above?\n\nI've rarely seen any test framework for any language which documents the order as `actual, expected` - most either don't assign a specific meaning or use `expected, actual`.",
"title": "Change error message of a failing `assert_eq!`"
}