diff options
| author | Carlos Martín Nieto <[email protected]> | 2015-01-04 12:14:12 +0000 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2015-01-04 12:14:12 +0000 |
| commit | dff9badc05f5fd98e8f6d002e1537c7ee3ef634f (patch) | |
| tree | 6c050ae008188bd34c7f72a6d49d60e17d6003aa /diff_test.go | |
| parent | dae3004ca339f568db8991cf4d93d0ad6fbaffd1 (diff) | |
| parent | 18aea4bfe89b83c5e2d6d55daa68efa6180655cc (diff) | |
Merge commit '18aea4bfe89b83c5e2d6d55daa68efa6180655cc'
Diffstat (limited to 'diff_test.go')
| -rw-r--r-- | diff_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/diff_test.go b/diff_test.go index 7c54f4e..fc6fed9 100644 --- a/diff_test.go +++ b/diff_test.go @@ -148,6 +148,20 @@ func TestDiffTreeToTree(t *testing.T) { if want1, want2 := "x1/README", "y1/README"; !strings.Contains(patches[0], want1) || !strings.Contains(patches[0], want2) { t.Errorf("Diff patch doesn't contain %q or %q\n\n%s", want1, want2, patches[0]) + + } + + stats, err := diff.Stats() + checkFatal(t, err) + + if stats.Insertions() != 1 { + t.Fatal("Incorrect number of insertions in diff") + } + if stats.Deletions() != 1 { + t.Fatal("Incorrect number of deletions in diff") + } + if stats.FilesChanged() != 1 { + t.Fatal("Incorrect number of changed files in diff") } errTest := errors.New("test error") |
