Skip to content

Commit

Permalink
Merge pull request #47 from tommilligan/travis-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tommilligan committed Feb 9, 2021
2 parents 2f4058a + 8bf1e42 commit 55e607c
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 9 deletions.
41 changes: 36 additions & 5 deletions .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
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,5 @@
# Unreleased

## Internal

- Test Windows targets in CI (#46, @tommilligan)
6 changes: 5 additions & 1 deletion Cargo.toml
@@ -1,7 +1,11 @@
[package]
name = "pretty_assertions"
version = "0.6.1"
authors = ["Colin Kiegel <kiegel@gmx.de>", "Florent Fayolle <florent.fayolle69@gmail.com>"]
authors = [
"Colin Kiegel <kiegel@gmx.de>",
"Florent Fayolle <florent.fayolle69@gmail.com>",
"Tom Milligan <code@tommilligan.net>",
]
edition = "2018"

description = "Overwrite `assert_eq!` and `assert_ne!` with drop-in replacements, adding colorful diffs."
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/format_changeset.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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)?;
Expand All @@ -145,7 +145,7 @@ pub fn format_replacement(f: &mut dyn fmt::Write, added: &str, removed: &str) ->
}
}

writeln!(f, "")
writeln!(f)
}

#[test]
Expand Down
2 changes: 2 additions & 0 deletions tests/assert_ne.rs
@@ -1,3 +1,5 @@
#![allow(clippy::eq_op)]

#[allow(unused_imports)]
use pretty_assertions::{assert_eq, assert_ne};
#[test]
Expand Down

0 comments on commit 55e607c

Please sign in to comment.