Hamcrest is a framework that assists writing software tests in the Java programming language. It supports creating customized assertion matchers ('Hamcrest' is an anagram of 'matchers'), allowing match rules to be defined declaratively.[1] These matchers have uses in unit testing frameworks such as JUnit and jMock. Hamcrest has been included in JUnit 4 since 2012,[2] but was omitted from JUnit 5 in 2017.[3]
Hamcrest has been ported to C++, C#,[4] Objective-C, Python,[5] ActionScript 3,[6] PHP,[7] JavaScript,[8] Erlang,[9] R,[10] Rust,[11] Java, PHP, Go, Common Lisp and Swift.[12]