diff --git a/.travis.yml b/.travis.yml index cc65ef3..9b4a4a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,43 @@ -sudo: false language: rust cache: cargo +dist: focal + +# this matrix generates jobs for the `test` stage +os: + - linux + - windows rust: - nightly - beta - stable - 1.35.0 -script: | - cargo build && - cargo test && - cargo doc + +# run only one job first to see if it fails, then run the rest +jobs: + include: + - stage: fast-test + os: linux + rust: stable + # additional behaviour just for this comprehensive job + before_install: | + rustup component add rustfmt clippy + cargo install cargo-audit cargo-tarpaulin + script: | + cargo fmt -- --check + cargo audit --deny warnings + cargo clippy --all-targets -- -D warnings + cargo test + cargo doc --no-deps + after_success: | + cargo tarpaulin --out xml + bash <(curl -s https://codecov.io/bash) + exclude: + - stage: test + os: linux + rust: stable + allow_failures: + - rust: nightly + +stages: + - fast-test + - test diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..62d3a82 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Unreleased + +## Internal + +- Test Windows targets in CI (#46, @tommilligan) diff --git a/Cargo.toml b/Cargo.toml index 2f78d9a..9651cd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,11 @@ [package] name = "pretty_assertions" version = "0.6.1" -authors = ["Colin Kiegel ", "Florent Fayolle "] +authors = [ + "Colin Kiegel ", + "Florent Fayolle ", + "Tom Milligan ", +] edition = "2018" description = "Overwrite `assert_eq!` and `assert_ne!` with drop-in replacements, adding colorful diffs." diff --git a/README.md b/README.md index 59d0f1b..69fa988 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ use pretty_assertions::{assert_eq, assert_ne}; a diff. * Under Windows, the terminal state is modified to properly handle VT100 escape sequences, which may break display for certain use cases. +* The minimum supported rust version (MSRV) is 1.35.0 ## License diff --git a/src/format_changeset.rs b/src/format_changeset.rs index ad175de..5c4b434 100644 --- a/src/format_changeset.rs +++ b/src/format_changeset.rs @@ -17,7 +17,7 @@ const SIGN_LEFT: char = '<'; // - < ← // Credits johannhof (MIT License) pub fn format_changeset(f: &mut fmt::Formatter, changeset: &Changeset) -> fmt::Result { - let ref diffs = changeset.diffs; + let diffs = &changeset.diffs; writeln!( f, @@ -119,7 +119,7 @@ pub fn format_replacement(f: &mut dyn fmt::Write, added: &str, removed: &str) -> _ => (), } } - writeln!(f, "")?; + writeln!(f)?; // RIGHT side (==what's new) paint!(f, Green, "{}", SIGN_RIGHT)?; @@ -145,7 +145,7 @@ pub fn format_replacement(f: &mut dyn fmt::Write, added: &str, removed: &str) -> } } - writeln!(f, "") + writeln!(f) } #[test] diff --git a/tests/assert_ne.rs b/tests/assert_ne.rs index 7218f72..b5d7b08 100644 --- a/tests/assert_ne.rs +++ b/tests/assert_ne.rs @@ -1,3 +1,5 @@ +#![allow(clippy::eq_op)] + #[allow(unused_imports)] use pretty_assertions::{assert_eq, assert_ne}; #[test]