Update changelog and tests for new path printing logic

pull/504/head
Wilfred Hughes 2023-04-15 21:08:40 +07:00
parent f08e77a675
commit bde09efb80
2 changed files with 22 additions and 0 deletions

@ -4,6 +4,18 @@
Added support for Solidity.
### Display
When difftastic is invoked with two file paths, it will now truncate
the path shown to the shared common parts. This is particularly
helpful when using difftastic with mercurial.
```
$ difft dir1/foo/bar.py dir2/foo/bar.py
foo/bar.py -- Python
...
```
## 0.46 (released 31st March 2023)
### Command Line Interface

@ -160,3 +160,13 @@ fn git_style_arguments_rename() {
let predicate_fn = predicate::str::contains("Renamed");
cmd.assert().stdout(predicate_fn);
}
#[test]
fn drop_different_path_starts() {
let mut cmd = Command::cargo_bin("difft").unwrap();
cmd.arg("sample_files/dir_before/clojure.clj")
.arg("sample_files/dir_after/clojure.clj");
let predicate_fn = predicate::str::contains("dir_after/clojure.clj").not();
cmd.assert().stdout(predicate_fn);
}