Registry / testing / assert-panic

assert-panic

JSON →
library1.0.1rscratesunverified

Assert that a panic happens, and optionally what kind of panic.

# Cargo.toml [dependencies] assert-panic = "1.0.1"
INSTALL
IMPORT
SIG · ASSERT-PANIC
A
assert-panic
testingrustv1.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

assert_panic
use assert_panic::assert_panic;

Assert that a panic occurs in a test.

use assert_panic::assert_panic; fn main() { assert_panic!(panic!("expected panic")); assert_panic!( panic!("custom message"), "custom message" ); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
22
OpenAI (training)
1
Resources
assert-panic — cargo add assert-panic · libregistry