Hamcrest

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]

  1. ^ "The Hamcrest Tutorial".
  2. ^ Marc Philipp (21 Oct 2012). "Summary of Changes in version 4.4". JUnit documentation. Retrieved 20 Sep 2016.
  3. ^ "JUnit 5 User Guide - Third-party Assertion Libraries". Retrieved 11 May 2018.
  4. ^ "NHamcrest". GitHub. 29 July 2021.
  5. ^ "PyHamcrest".
  6. ^ "Hamcrest-AS3". GitHub. 4 July 2020.
  7. ^ "Hamcrest - Google Code".
  8. ^ "Hamcrest4Qunit". GitHub. 22 September 2021.
  9. ^ "Hamcrest Erlang". GitHub. 22 February 2022.
  10. ^ "Hamcrest for Renjin".
  11. ^ "Hamcrest Cargo package".
  12. ^ "Hamcrest for Swift". GitHub. 23 February 2022.