You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update tests to match on invariant rather than display #707
assert!(matches!(
ctx.process_proposal(proposal),Err(InternalProposalError::LockTimesDontMatch{
proposed,
original
})if proposed == proposed_locktime && original == original_locktime
));
which does not match on the display impl but on the variant itself, and avoids the unwrap, but I suppose that can be saved for a follow up. An LLM should be able to do this conversion and then you can self review before asking for one here, but it should be one-shot.
changed the title [-]Update tests to match on invariant rather than string[/-][+]Update tests to match on invariant rather than display[/+]on May 21, 2025
nightly std::assert has assert_matches which improves the output, so perhaps we should define a #[cfg(not(version(???))] that is just assert!(matches!(...)) so that we can use the same syntax in older versions too?
Activity
[-]Update tests to match on invariant rather than string[/-][+]Update tests to match on invariant rather than display[/+]nothingmuch commentedon May 22, 2025
nightly std::assert has assert_matches which improves the output, so perhaps we should define a
#[cfg(not(version(???))]that is justassert!(matches!(...))so that we can use the same syntax in older versions too?Update some test assertions to compare the invariant vs display string (