Skip to content

Test-Case v0.3.1

Choose a tag to compare

@frondeus frondeus released this 01 Oct 20:59
· 134 commits to master since this 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.

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