Registry / testing / hamcrest2

hamcrest2

JSON →
library0.3.0rscratesunverified

A port of the Hamcrest testing library for Rust, providing expressive matchers for test assertions.

# Cargo.toml [dependencies] hamcrest2 = "0.3.0"
INSTALL
IMPORT
SIG · HAMCREST2
H
hamcrest2
testingrustv0.3.0
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_that
use hamcrest2::prelude::*;

Uses the `assert_that!` macro with a matcher to assert equality.

use hamcrest2::prelude::*; fn main() { let value = 5; assert_that!(value, is(equal_to(5))); println!("Assertion passed!"); }
Debug
Known issues
gotchaFork of the original hamcrest-rust crate which is unmaintained; some matchers may differ in behavior.
fix
Refer to hamcrest2 documentation for the exact list of matchers and their signatures.
affects: *
Upgrade
Version history
0.3.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
hamcrest2 — cargo add hamcrest2 · libregistry