Skip to content

Releases: frondeus/test-case

TestCase - v1.0.1

12 Jan 11:01
Compare
Choose a tag to compare

Legacy release supporting MSRV < 1.39, including syn::export fix

Test-Case v1.1.0

10 Jan 11:11
Compare
Choose a tag to compare

New features

  • Added support for using hamcrest2 assertions with test case
  • Enabled support of async via tokio or similar
  • Enabled attribute passthrough for test cases - it means that you can combine test-case with other testing frameworks,
    given at least one #[test_case] attribute appears before mentioned framework in testing function

Deprecation

  • inconclusive inside test case name will not be supported starting 2.0.0

Test-Case v1.0.0

28 Jan 15:04
Compare
Choose a tag to compare

Overview

This crate provides #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input parameters.
A test is generated for each data set passed in test_case attribute.
Under the hood, all test cases that share same body are grouped into mod, giving clear and readable test results.

New features

  • Added support for three new keywords: panics, matches and inconclusive which can be applied after => token.

    matches gives possibility to test patterns, like:

    #[test_case("foo" => matches Some(("foo", _)))]

    panics gives should_panic(expected="...") for one test_case:

    #[test_case(true  => panics "Panic error message" ; "This should panic")]
    #[test_case(false => None                         ; "But this should return None")]

    inconclusive ignores one specific test case.- thanks to @luke-biel

    #[test_case("42")]
    #[test_case("XX" ; "inconclusive - parsing letters temporarily doesn't work, but it's ok")]
    #[test_case("na" => inconclusive ())]

Major improvements

  • Added extra unit tests - thanks to @luke-biel
  • Replace parented_test_case with parsing test_case directly from args - thanks to @luke-biel
  • Added keeping trailing underscores in names - thanks to @rzumer

Minor improvements

  • Moved lazy-static dependency to dev-dependencies
  • Fixed README - thanks to @luke-biel and @drwilco

Upgraded dependencies

  • Upgraded insta to 0.12.0

Test-Case v1.0.0-alpha-1

05 Nov 15:47
Compare
Choose a tag to compare
Pre-release

Overview

This crate provides #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input parameters.
A test is generated for each data set passed in test_case attribute.
Under the hood, all test cases that share same body are grouped into mod, giving clear and readable test results.

New features

  • Add support for two new keywords: panics and matches which can be applied after => token.

    matches gives possibility to test patterns, like:

    #[test_case("foo" => matches Some(("foo", _)))]

    panics gives should_panic(expected="...") for one test_case:

    #[test_case(true  => panics "Panic error message" ; "This should panic")]
    #[test_case(false => None                         ; "But this should return None")]

Major improvements

  • Add extra unit tests - thanks to @luke-biel
  • Replace parented_test_case with parsing test_case directly from args - thanks to @luke-biel

Minor improvements

  • Moved lazy-static dependency to dev-dependencies

Upgraded dependencies

  • Upgraded insta to 0.12.0

Test-Case v0.3.3

01 Oct 20:49
Compare
Choose a tag to compare

Bugfixes

  • Fixed "inconclusive" feature with different cases.
      #[test_case(1 ; "this test is inconclusive and will always be")]
      #[test_case(2 ; "this test is also Inconclusive")]
      #[test_case(3 ; "this test is also INCONCLUSIVE even uppercase")]
      #[test_case(4 ; "this test is also iNCONCLUSIVE even inverted caps")]

Test-Case v0.3.2

01 Oct 12:06
Compare
Choose a tag to compare

Overview

This crate provides #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input parameters.
A test is generated for each data set passed in test_case attribute.
Under the hood, all test cases that share same body are grouped into mod, giving clear and readable test results.

Bugfixes

  • Added support for impl Trait - it worked in 2.x crate.

Minor improvements

  • Added extra test cases

Upgraded dependencies

  • Upgraded version_check to v0.9.1

Test-Case v0.3.1

01 Oct 20:59
Compare
Choose a tag to compare

Overview

This crate provides #[test_case] procedural macro attribute that generates multiple parametrized tests using one body with different input parameters.
A test is generated for each data set passed in test_case attribute.
Under the hood, all test cases that share same body are grouped into mod, giving clear and readable test results.

Breaking changes

  • Crate has new maintainer: Wojciech Polak ✋ 🎉
  • Crate has new name, as test-case-derive had no meaning for derive part.
  • Delimiter for test case description is ; instead of ::.

Reason: :: is valid part of expression and rustc treats const variable as path

New features

  • Proper error propagation 🎉
    When there is for example a typo in function body, rustc can now show location
    of it instead of test_case location.
  • Internally for tests crate uses cargo insta for snapshot testing
  • Attribute is now compatible with all other attributes like #[should_panic], however these attributes will be applied on every test case

Minor improvements:

  • Refreshed readme
  • Added CI for stable version of Rust. - thanks to @macisamuele
  • Limited crate to Rust 1.29+ - thanks to @macisamuele

Upgraded dependencies:

  • Upgraded syn, quote and proc-macro-2 to v1
  • Upgraded lazy-static to 1.4.0
  • Upgraded insta to 0.11.0