From owner-svn-src-head@freebsd.org Mon Jun 12 05:11:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C03BF4137; Mon, 12 Jun 2017 05:11:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E734182461; Mon, 12 Jun 2017 05:11:44 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v5C5BhMO088923; Mon, 12 Jun 2017 05:11:43 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v5C5Bh9K088922; Mon, 12 Jun 2017 05:11:43 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201706120511.v5C5Bh9K088922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 12 Jun 2017 05:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r319847 - head/usr.bin/diff/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2017 05:11:45 -0000 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 }