Skip to content

Commit

Permalink
Update test-case msrv policy (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-biel committed Feb 9, 2023
1 parent 29db360 commit 5755171
Show file tree
Hide file tree
Showing 30 changed files with 20 additions and 351 deletions.
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
toolchain:
- nightly
- stable
- 1.49.0

steps:
- name: Checkout source code
Expand Down
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ regex = { version = "1.5", optional = true }
[dev-dependencies]
insta = "1.12"
itertools = "0.10"
indexmap = "=1.8.2"
serde_yaml = "=0.8.25"
linked-hash-map = "=0.5.4"
regex = "1.5"
once_cell = "=1.13.0"

[workspace]
members = ["crates/*"]
Expand Down
1 change: 0 additions & 1 deletion README.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Crates.io](https://img.shields.io/crates/v/test-case.svg)](https://crates.io/crates/test-case)
[![Crates.io](https://img.shields.io/crates/d/test-case.svg)](https://crates.io/crates/test-case)
[![1.49+](https://img.shields.io/badge/rust-1.49.0%2B-orange.svg)](https://img.shields.io/badge/rust-1.49.0%2B-orange.svg)
[![Docs.rs](https://docs.rs/test-case/badge.svg)](https://docs.rs/test-case)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/rust-lang/docs.rs/master/LICENSE)
[![Build Status](https://github.com/frondeus/test-case/workflows/Test/badge.svg)](https://github.com/frondeus/test-case/actions)
Expand Down
8 changes: 4 additions & 4 deletions crates/test-case-macros/src/complex_expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,18 @@ impl Display for PathToken {
impl Display for ComplexTestCase {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
ComplexTestCase::Not(not) => write!(f, "not {}", not),
ComplexTestCase::Not(not) => write!(f, "not {not}"),
ComplexTestCase::And(cases) => {
write!(f, "{}", cases[0])?;
for case in cases[1..].iter() {
write!(f, " and {}", case)?;
write!(f, " and {case}")?;
}
Ok(())
}
ComplexTestCase::Or(cases) => {
write!(f, "{}", cases[0])?;
for case in cases[1..].iter() {
write!(f, " or {}", case)?;
write!(f, " or {case}")?;
}
Ok(())
}
Expand All @@ -181,7 +181,7 @@ impl Display for ComplexTestCase {
fmt_syn(expected_value),
fmt_syn(precision)
),
ComplexTestCase::Path(Path { token }) => write!(f, "path {}", token),
ComplexTestCase::Path(Path { token }) => write!(f, "path {token}"),
ComplexTestCase::Contains(Contains { expected_element }) => {
write!(f, "contains {}", fmt_syn(expected_element))
}
Expand Down
4 changes: 2 additions & 2 deletions crates/test-case-macros/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Parse for TestCaseExpression {
impl Display for TestCaseExpression {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
for kw in &self.extra_keywords {
write!(f, "{:?}", kw)?;
write!(f, "{kw:?}")?;
}
write!(f, "{}", self.result)
}
Expand All @@ -110,7 +110,7 @@ impl Display for TestCaseResult {
),
TestCaseResult::With(expr) => write!(f, "with {}", fmt_syn(expr)),
TestCaseResult::UseFn(expr) => write!(f, "use {}", fmt_syn(expr)),
TestCaseResult::Complex(complex) => write!(f, "complex {}", complex),
TestCaseResult::Complex(complex) => write!(f, "complex {complex}"),
TestCaseResult::Empty => write!(f, "empty"),
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/test-case-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn test_case(args: TokenStream, input: TokenStream) -> TokenStream {
Err(err) => {
return syn::Error::new(
attr.span(),
format!("cannot parse test_case arguments: {}", err),
format!("cannot parse test_case arguments: {err}"),
)
.to_compile_error()
.into()
Expand Down
2 changes: 1 addition & 1 deletion crates/test-case-macros/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn escape_test_name(input: impl AsRef<str>) -> Ident {
.collect();

if !ident.starts_with(|c: char| c == '_' || c.is_ascii_alphabetic()) {
ident = format!("_{}", ident);
ident = format!("_{ident}");
}

Ident::new(&ident, Span::call_site())
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
//! test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
//! ```
//!
//! # MSRV Policy
//!
//! Starting with version 3.0 and up `test-case` introduces policy of only supporting latest stable Rust.
//! These changes may happen overnight, so if your stack is lagging behind current stable release,
//! it may be best to consider locking `test-case` version with `=` in your `Cargo.toml`.
//!
//! # Documentation
//!
//! Most up to date documentation is available in our [wiki](https://github.com/frondeus/test-case/wiki).
Expand Down

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions tests/snapshots/rust-1.49.0/acceptance__cases_can_be_ignored.snap

This file was deleted.

20 changes: 0 additions & 20 deletions tests/snapshots/rust-1.49.0/acceptance__cases_can_panic.snap

This file was deleted.

This file was deleted.

38 changes: 0 additions & 38 deletions tests/snapshots/rust-1.49.0/acceptance__cases_can_use_regex.snap

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5755171

Please sign in to comment.