diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d1c2d2..8b2b480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - ReleaseDate +#### Breaking Changes + +- `predicates::str::diff` was removed +- `predicates::str::similar` was renamed to `diff` +- The `difference` feature flag was renamed to `diff` +- `diff().split` and `diff().distance` were removed + +#### Fixes + +- Shrink the output of Diffs because its redundant +- Moved off of an unmaintained Diff library + ## [1.0.4] - 2021-05-12 #### Features diff --git a/Cargo.toml b/Cargo.toml index 58bbbc9..0af3390 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,9 +21,10 @@ maintenance = { status = "passively-maintained" } name = "bin_fixture" [dependencies] -predicates = { version = "1.0", default-features = false, features = ["difference"] } -predicates-core = "1.0" -predicates-tree = "1.0" +predicates = { version = "1.0", default-features = false, features = ["diff"], path="../predicates-rs" } +predicates-core = {version="1.0", path="../predicates-rs/crates/core" } +predicates-tree = {version="1.0", path="../predicates-rs/crates/tree" } + doc-comment = "0.3" wait-timeout = "0.2.0" bstr = "0.2.14" diff --git a/src/assert.rs b/src/assert.rs index 0052a93..797445f 100644 --- a/src/assert.rs +++ b/src/assert.rs @@ -295,7 +295,7 @@ impl Assert { /// .env("stdout", "hello") /// .env("stderr", "world") /// .assert() - /// .stdout(predicate::str::similar("hello\n")); + /// .stdout(predicate::str::diff("hello\n")); /// ``` /// /// Accepting bytes: @@ -379,7 +379,7 @@ impl Assert { /// .env("stdout", "hello") /// .env("stderr", "world") /// .assert() - /// .stderr(predicate::str::similar("world\n")); + /// .stderr(predicate::str::diff("world\n")); /// ``` /// /// Accepting bytes: @@ -654,7 +654,7 @@ impl IntoCodePredicate for &'static [i32] { /// .env("stdout", "hello") /// .env("stderr", "world") /// .assert() -/// .stdout(predicate::str::similar("hello\n").from_utf8()); +/// .stdout(predicate::str::diff("hello\n").from_utf8()); /// /// // which can be shortened to: /// Command::cargo_bin("bin_fixture") @@ -785,12 +785,12 @@ pub struct StrContentOutputPredicate( impl StrContentOutputPredicate { pub(crate) fn from_str(value: &'static str) -> Self { - let pred = predicates::str::similar(value).from_utf8(); + let pred = predicates::str::diff(value).from_utf8(); StrContentOutputPredicate(pred) } pub(crate) fn from_string(value: String) -> Self { - let pred = predicates::str::similar(value).from_utf8(); + let pred = predicates::str::diff(value).from_utf8(); StrContentOutputPredicate(pred) } } @@ -862,7 +862,7 @@ impl IntoOutputPredicate for &'static str { /// .env("stdout", "hello") /// .env("stderr", "world") /// .assert() -/// .stderr(predicate::str::similar("world\n")); +/// .stderr(predicate::str::diff("world\n")); /// ``` #[derive(Debug, Clone)] pub struct StrOutputPredicate>( diff --git a/tests/assert.rs b/tests/assert.rs index c2727a4..d912802 100644 --- a/tests/assert.rs +++ b/tests/assert.rs @@ -93,7 +93,7 @@ fn stdout_example() { .env("stdout", "hello") .env("stderr", "world") .assert() - .stdout(predicate::str::similar("hello\n")); + .stdout(predicate::str::diff("hello\n")); Command::cargo_bin("bin_fixture") .unwrap() @@ -131,7 +131,7 @@ fn stderr_example() { .env("stdout", "hello") .env("stderr", "world") .assert() - .stderr(predicate::str::similar("world\n")); + .stderr(predicate::str::diff("world foo\n")); Command::cargo_bin("bin_fixture") .unwrap()