Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jun 2017 05:11:43 +0000 (UTC)
From:      Ngie Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r319847 - head/usr.bin/diff/tests
Message-ID:  <201706120511.v5C5Bh9K088922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Mon Jun 12 05:11:43 2017
New Revision: 319847
URL: https://svnweb.freebsd.org/changeset/base/319847

Log:
  Add some testcases for `diff --side-by-side` support
  
  These are were created proactively, in anticipation of the support being
  fully implemented sometime in the future.
  
  The tests currently fail on ^/head@r319845, however. Expect them to fail.
  
  PR:		219933
  Tested with:	gdiff

Modified:
  head/usr.bin/diff/tests/diff_test.sh

Modified: head/usr.bin/diff/tests/diff_test.sh
==============================================================================
--- head/usr.bin/diff/tests/diff_test.sh	Mon Jun 12 02:42:39 2017	(r319846)
+++ head/usr.bin/diff/tests/diff_test.sh	Mon Jun 12 05:11:43 2017	(r319847)
@@ -6,6 +6,7 @@ atf_test_case header
 atf_test_case header_ns
 atf_test_case ifdef
 atf_test_case group_format
+atf_test_case side_by_side
 
 simple_body()
 {
@@ -88,6 +89,26 @@ group_format_body()
 ' "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in"
 }
 
+side_by_side_body()
+{
+	atf_expect_fail "--side-by-side not currently implemented (bug # 219933)"
+
+	atf_check -o save:A printf "A\nB\nC\n"
+	atf_check -o save:B printf "D\nB\nE\n"
+
+	exp_output="A[[:space:]]+|[[:space:]]+D\nB[[:space:]]+B\nC[[:space:]]+|[[:space:]]+E"
+	exp_output_suppressed="A[[:space:]]+|[[:space:]]+D\nC[[:space:]]+|[[:space:]]+E"
+
+	atf_check -o match:"$exp_output" -s exit:1 \
+	    diff --side-by-side A B
+	atf_check -o match:"$exp_output" -s exit:1 \
+	    diff -y A B
+	atf_check -o match:"$exp_output_suppressed" -s exit:1 \
+	    diff -y --suppress-common-lines A B
+	atf_check -o match:"$exp_output_suppressed" -s exit:1 \
+	    diff -W 65 -y --suppress-common-lines A B
+}
+
 atf_init_test_cases()
 {
 	atf_add_test_case simple
@@ -96,4 +117,5 @@ atf_init_test_cases()
 	atf_add_test_case header_ns
 	atf_add_test_case ifdef
 	atf_add_test_case group_format
+	atf_add_test_case side_by_side
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706120511.v5C5Bh9K088922>