-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add failing test of copied file diff
Ref #392
- Loading branch information
1 parent
6358ee8
commit 2b19aef
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,17 @@ mod tests { | |
)); | ||
} | ||
|
||
#[test] | ||
fn test_copied_file() { | ||
let config = integration_test_utils::make_config_from_args(&[]); | ||
let output = integration_test_utils::run_delta(GIT_DIFF_WITH_COPIED_FILE, &config); | ||
let output = strip_ansi_codes(&output); | ||
assert!(test_utils::contains_once( | ||
&output, | ||
"\ncopied: first_file ⟶ copied_file\n" | ||
)); | ||
} | ||
|
||
#[test] | ||
fn test_renamed_file_with_changes() { | ||
let config = integration_test_utils::make_config_from_args(&[]); | ||
|
@@ -1591,6 +1602,19 @@ diff --git a/foo b/foo | |
new file mode 100644 | ||
index 0000000..b572921 | ||
Binary files /dev/null and b/foo differ | ||
"; | ||
|
||
const GIT_DIFF_WITH_COPIED_FILE: &str = " | ||
commit f600ed5ced4d98295ffa97571ed240cd86c34ac6 (HEAD -> master) | ||
Author: Dan Davison <[email protected]> | ||
Date: Fri Nov 20 20:18:30 2020 -0500 | ||
copy | ||
diff --git a/first_file b/copied_file | ||
similarity index 100% | ||
copy from first_file | ||
copy to copied_file | ||
"; | ||
|
||
// git --no-pager show -p --cc --format= --numstat --stat | ||
|