Skip to content

Commit

Permalink
Add failing test of copied file diff
Browse files Browse the repository at this point in the history
Ref #392
  • Loading branch information
dandavison committed Nov 21, 2020
1 parent 6358ee8 commit 2b19aef
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/tests/test_example_diffs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(&[]);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2b19aef

Please sign in to comment.