]> khamidou — GitHub mirrors - arcanist.git/commit
Improve test coverage of diff/patch generation
authorepriestley <git@epriestley.com>
Sat, 20 Oct 2012 15:43:13 +0000 (08:43 -0700)
committerepriestley <git@epriestley.com>
Sat, 20 Oct 2012 15:43:13 +0000 (08:43 -0700)
commit4b03a3fa0d04ac6d6076263bf4735b4770837712
treeb11aa6010f994d2c8c5868e11cbfd092b285892a
parent5981aa1df4578e8c8b564995f5931a68c05b5f7a
Improve test coverage of diff/patch generation

Summary:
We have coverage for generating patches, applying them, and making sure they reproduce the original repository state. However:

  - The code uses simplified patch generation which omits some flags like `-M` and `-C`, and generally produces less rich patches than we really produce. Instead, produce patches the same way `arc diff` does.
  - We don't test the intermediate change representation. In theory it's not too important because if we get it wrong the output should be wrong, but in practice it makes it easier to nail down issues. We can also generate less-rich patches which still apply correctly, but would prefer not to.
  - Similarly, we don't test the intermediate patch representation. This is almost entirely redundant with simply applying the patch, but easier to visualize.

Add coverage for all that stuff and fix some bugs with `-M` / `-C` patch generation that weren't caught under the simpler patch generation.

Test Plan: Ran unit tests.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran
Maniphest Tasks: T866

Differential Revision: https://secure.phabricator.com/D3751
16 files changed:
src/parser/ArcanistBundle.php
src/parser/__tests__/ArcanistBundleTestCase.php
src/parser/__tests__/patches/176a4c2c3fd88b2d598ce41a55d9c3958be9fd2d.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/337ccec314075a2bdb4a912ef467d35d04a713e4.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/3f5c6d735e64c25a04f83be48ef184b25b5282f0.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/49395994a1a8a06287e40a3b318be4349e8e0288.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/5de5f3dfda1b7db2eb054e57699f05aaf1f4483e.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/5dec8bf28557f078d1987c4e8cfb53d08310f522.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/6d5e64a4a7a6a036c53b1d087184cb2c70099f2c.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/a5a53c424f3c2a7e85f6aee35e834c8ec5b3dbe3.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/a73b28e139296d23ade768f2346038318b331f94.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/b454edb3bb29890ee5b3af5ef66ce6a24d15d882.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/d53dc614090c6c7d6d023e170877d7f611f18f5a.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/df340e88d8aba12e8f2b8827f01f0cd9f35eb758.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/f19fb9fa1385c01b53bdb6d8842dd154e47151ec.gitpatch [new file with mode: 0644]
src/parser/__tests__/patches/fb28468d25a5fdd063aca4ca559454c998a0af51.gitpatch [new file with mode: 0644]