Skip to content
Myr

Test 1-argument ensure

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Tolnay · committed by David Tolnay · parent da82eba · Browse files · 1 file+9 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−0 removed

  • tests:+9 added−0 removed

1 file+9 added−0 removed

modified:tests/test_macros.rs+9 added
30 unmodified lines
31 ensure!(v + v == 1, "This is not correct, v: {}", v);32 Ok(())33 };34 assert!(f().is_err());3536 let f = || {37 ensure!(v + v == 1);38 Ok(())39 };40 assert_eq!(41 f().unwrap_err().to_string(),42 "Condition failed: `v + v == 1`",43 );44}