Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test-case requirement from 1.1 to 2.0 #376

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 23, 2022

Updates the requirements on test-case to permit the latest version.

Release notes

Sourced from test-case's releases.

TestCase - v2.0.0

Overview

This crate provides the #[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 the test_case attribute. Under the hood, all test cases that share the same body are grouped into a mod, giving clear and readable test results.

What's changed

New features

  • => with |x: T| assert!(x) custom inline test assertions
  • => using path::to::fn custom fn test assertions
  • ignore and inconclusive can be combined with other keywords
  • => it|is ... syntax is a built-in (previously required hamcrest2 crate integration)
  • Simple test cases support returning Result<(), _> as #[test] attribute does #50

Improvements

  • Code refactoring
  • Test function is kept in its original scope so it can be reused for non-test related code #77
  • Improved test case name selection

Breaking changes

  • Deprecation of inconclusive within test description string - it will no longer act like modifier keyword
  • Removal of hamcrest2 integration (it and is are kept, complex assertions now have different syntax)

Custom inline test assertions

Now it is possible to pass the closure which will assert the test case.

#[test_case(1.0 => with |v: f64| assert!(v.is_infinite()))]
#[test_case(0.0 => with |v: f64| assert!(v.is_nan()))]
fn divide_by_zero_f64_with_lambda(input: f64) -> f64 {
    input / 0.0f64
}

Custom fn test assertions

Not only the closure is possible but also you can point to the plain function:

Given:

fn assert_is_power_of_two(input: u64) {
    assert!(input.is_power_of_two())
}

You can now assert:

... (truncated)

Changelog

Sourced from test-case's changelog.

2.0.0

New features

  • => with |x: T| assert!(x) custom inline test assertions
  • => using path::to::fn custom fn test assertions
  • ignore|inconclusive can be combined with other keywords (eg.: => ignore matches Ok(_))
  • => it|is ... syntax is a built-in (previously required hamcrest2 crate integration)
  • Tested items are left in place where they were defined #77
  • Simple test cases allow Result<(), _> return types similar to native #[test] macro

Improvements

  • Significant code refactoring
  • Improved test case name selection

Breaking changes

  • Deprecation of inconclusive within test description string - it will no longer act like modifier keyword
  • Deprecation of hamcrest2 integration
  • Deprecation of allow_result feature

V1.2.3

  • Fix regression where panics and inconclusive were not allowed on test_cases returning a value
  • Fix case where test_case would allow to return a type when only single attribute was used

V1.2.2

  • test-case no longer allows returning values from tested function without => pattern (thanks to @​tarka)
    • Behaviour can be reenabled via allow_result feature

V1.2.1

  • Disabled clippy warning when test-case was generating assert_eq(bool, bool) expression.

V1.2.0

New features

  • Allow usage of fully qualified attribute #[test_case::test_case] (thanks to @​tomprince)

Improvements

  • Stopped code from emmiting unneded () expression in test cases with expected fragment (thanks to @​martinvonz)

V1.1.0

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

V1.0.0

New features

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

... (truncated)

Commits
  • 6301fbd Improve readme & changelog. Publish version 2.0.0.
  • 1c43651 Update README. Move most of technical documentation to our wiki.
  • 26e0fc4 Omit line with full path to hash-encoded dir
  • c7ca456 Revert echo's in publish.sh
  • 4b139fe Bump version to 2.0.0-rc3.
  • c7a098c Tweak test_case handling (#88)
  • f4edb1d Update README to mention rc2
  • 9950c3e Relaxed requirements on 'using' keyword in complex test cases.
  • 70bff0b Add newlines to publish.sh 'Next steps' echo
  • f848378 Bump MSRV to 1.49. Adjust template. Release 2.0.0-rc2
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [test-case](https://github.com/frondeus/test-case) to permit the latest version.
- [Release notes](https://github.com/frondeus/test-case/releases)
- [Changelog](https://github.com/frondeus/test-case/blob/master/CHANGELOG.md)
- [Commits](frondeus/test-case@v1.1.0...v2.0.0)

---
updated-dependencies:
- dependency-name: test-case
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot requested a review from sagebind as a code owner February 23, 2022 11:05
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Feb 23, 2022
@codecov
Copy link

codecov bot commented Feb 23, 2022

Codecov Report

Merging #376 (dea1319) into master (3a49173) will increase coverage by 0.12%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #376      +/-   ##
==========================================
+ Coverage   79.46%   79.59%   +0.12%     
==========================================
  Files          52       52              
  Lines        3092     3092              
==========================================
+ Hits         2457     2461       +4     
+ Misses        635      631       -4     
Impacted Files Coverage Δ
src/cookies/jar.rs 83.57% <0.00%> (+2.85%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a49173...dea1319. Read the comment docs.

@sagebind sagebind merged commit fad86fd into master Feb 24, 2022
@sagebind sagebind deleted the dependabot/cargo/test-case-2.0 branch February 24, 2022 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant