Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: tests/git_common_test.py

Issue 1629253002: git hyper-blame: Added approx. line number translation. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@git-hyper-blame
Patch Set: Added Caveats section to man page. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « man/src/git-hyper-blame.txt ('k') | tests/git_hyper_blame_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_common_test.py
diff --git a/tests/git_common_test.py b/tests/git_common_test.py
index 117fc93c38e33164f5e095dbf84789fcb11bb681..b4049445e75f58063741ce50b3979cd699ac0c45 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -254,6 +254,23 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
self.assertEqual(self.repo.run(set, self.gc.branches()),
{'master', 'branch_D', 'root_A'})
+ def testDiff(self):
+ # Get the names of the blobs being compared (to avoid hard-coding).
+ c_blob_short = self.repo.git('rev-parse', '--short',
+ 'tag_C:some/files/file2').stdout.strip()
+ d_blob_short = self.repo.git('rev-parse', '--short',
+ 'tag_D:some/files/file2').stdout.strip()
+ expected_output = [
+ 'diff --git a/some/files/file2 b/some/files/file2',
+ 'index %s..%s 100755' % (c_blob_short, d_blob_short),
+ '--- a/some/files/file2',
+ '+++ b/some/files/file2',
+ '@@ -1 +1,2 @@',
+ ' file2 - vanilla',
+ '+file2 - merged']
+ self.assertEqual(expected_output,
+ self.repo.run(self.gc.diff, 'tag_C', 'tag_D').split('\n'))
+
def testDormant(self):
self.assertFalse(self.repo.run(self.gc.is_dormant, 'master'))
self.repo.git('config', 'branch.master.dormant', 'true')
« no previous file with comments | « man/src/git-hyper-blame.txt ('k') | tests/git_hyper_blame_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698