Skip to content

Add test for rename support in multi file diff. #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 23, 2016

Conversation

dmitshur
Copy link
Contributor

Followup for #9 (comment).

This test passes now, but would fail before #9 was merged.

This is needed for rename FileDiffs that do not have a file header.
Followup for #9 (comment).

This test passes now, but would fail before #9 was merged.
@dmitshur
Copy link
Contributor Author

The sample_multi_file_rename.diff test case was created from an actual modified git commit, using git version 2.5.4 (Apple Git-61), rendered with the following flags:

git show -M HEAD

Before #9 was merged, the tests fails with:

go-diff $ go test -v ./...
?       sourcegraph.com/sourcegraph/go-diff/cmd/go-diff [no test files]
=== RUN   TestParseHunkNoChunksize
--- PASS: TestParseHunkNoChunksize (0.00s)
=== RUN   TestParseHunksAndPrintHunks
--- PASS: TestParseHunksAndPrintHunks (0.00s)
=== RUN   TestParseFileDiffAndPrintFileDiff
--- PASS: TestParseFileDiffAndPrintFileDiff (0.00s)
=== RUN   TestParseMultiFileDiffAndPrintMultiFileDiff
--- FAIL: TestParseMultiFileDiffAndPrintMultiFileDiff (0.00s)
    diff_test.go:159: sample_multi_file_rename.diff: got 2 instances of diff.FileDiff, expected 3
=== RUN   TestNoNewlineAtEnd
--- PASS: TestNoNewlineAtEnd (0.00s)
=== RUN   TestFileDiff_Stat
--- PASS: TestFileDiff_Stat (0.00s)
FAIL
FAIL    sourcegraph.com/sourcegraph/go-diff/diff    0.008s

After #9 is merged, all these tests pass.

@emidoots
Copy link
Member

LGTM

@dmitshur dmitshur merged commit ba62c45 into master Feb 23, 2016
@dmitshur dmitshur deleted the rename-fix-follow-test branch February 23, 2016 20:25
@dmitshur dmitshur changed the title Rename fix follow test Add test for rename support in multi file diff. Feb 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants