git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCHv3 6/8] t9500: Add basic sanity tests for side-by-side diff in gitweb

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 30, 2011, 23:36 UTC
Message-ID
<1320017787-18048-7-git-send-email-jnareb@gmail.com>
In-Reply-To
<1320017787-18048-1-git-send-email-jnareb@gmail.com>

Test that side-by-side diff can deal with incomplete lines (and while at it with pure addition, pure removal, and change), and with merge commits, producing no errors or warnings.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
---
This patch is new in this version.

Note this while it does not check if the output is sane, it can help with manual check; just run test with `--debug' option, and point gitweb to "t/trash\ directory.t9500-gitweb-standalone-no-errors/.git/" repository.

 t/t9500-gitweb-standalone-no-errors.sh |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index c731507..ab24917 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -329,7 +329,8 @@ test_expect_success \
 	 git add b &&
 	 git commit -a -m "On branch" &&
 	 git checkout master &&
-	 git pull . b'
+	 git pull . b &&
+	 git tag merge_commit'
 
 test_expect_success \
 	'commit(0): merge commit' \
@@ -379,6 +380,29 @@ test_expect_success \
 	'gitweb_run "p=.git;a=commitdiff;h=b"'
 
 # ----------------------------------------------------------------------
+# side-by-side diff
+
+test_expect_success 'side-by-side: addition of incomplete line' '
+	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_add;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: incomplete line as context line' '
+	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_ctx;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: changed incomplete line' '
+	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_chg;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: removal of incomplete line' '
+	gitweb_run "p=.git;a=commitdiff;h=incomplete_lines_rem;ds=sidebyside"
+'
+
+test_expect_success 'side-by-side: merge commit' '
+	gitweb_run "p=.git;a=commitdiff;h=merge_commit;ds=sidebyside"
+'
+
+# ----------------------------------------------------------------------
 # tags testing
 
 test_expect_success \
-- 
1.7.6
Previous: Jakub NarebskiNext: Jakub Narebski
Message 7 of 9 in “[PATCHv3 0/8] gitweb: side-by-side diff”
  1. Jakub NarebskiOct 30, 2011
  2. 1/8 gitweb: Refactor diff body line classificationJakub Narebski, Oct 30, 2011
  3. 2/8 gitweb: Extract formatting of diff chunk headerJakub Narebski, Oct 30, 2011
  4. 3/8 gitweb: Add a feature to show side-by-side diffJakub Narebski, Oct 30, 2011
  5. 4/8 gitweb: Give side-by-side diff extra CSS stylingJakub Narebski, Oct 30, 2011
  6. 5/8 t9500: Add test for handling incomplete lines in diff by gitwebJakub Narebski, Oct 30, 2011
  7. 6/8 t9500: Add basic sanity tests for side-by-side diff in gitwebJakub Narebski, Oct 30, 2011
  8. 7/8 gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"Jakub Narebski, Oct 30, 2011
  9. 8/8 gitweb: Add navigation to select side-by-side diffJakub Narebski, Oct 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.