From nobody Wed Dec 13 20:06:33 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Sr6220gHjz54Fkx; Wed, 13 Dec 2023 20:06:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Sr6214rY2z4ZJw; Wed, 13 Dec 2023 20:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ba+6YLXMTxXmjfwLL2u7W6Kb7+Zp8j0sFynPY68HjOg=; b=tH6VMowAe8GlKfRWSryQ6vnwnSlyTHpM8aseNco871S/7r9vUUVGqX+pl3wXA1khxSi6X0 L960VG0Fa6dyHyR6TmWTraGlMhWLw8QOZ3+68Z8Yr2e+Yixy13d2j5cBz0O78XxQT/A1U1 DC0rilykrTr0D2yBzf0Ls77MISyNQkE4BOiE2RiKRVKEVWtbgoRdr2m90/iYPoE8A8HaJ9 pMDgywBLBWbdvHqU+Aihi2eUSnl7ut5dQCXg67d9wqVxPv8drR2n+2VkdvpQZQeGYLbWmu oaYSB6orzyoek8mtLCWdX5+blDrjwc55xBswMaOCQe0Nj/DGlXPmO4aKAjoI3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702497993; a=rsa-sha256; cv=none; b=Nn/noEANQjeUdxovSovC+JPprZLN5liPAP2EI3bgia5tZK3iLDpCbkwRZ3fmWCgMvz9f+S b51LJhKPjp4eGnvJFZFw1HtVBhz+5WVTEH0yD0Hj7saEN5Ovq2G6peEDM/9eeG874VTR9A uCmQRCNn361Ywge8dOnFhTA3oqxbByd9OvNFfT106oKFjL79DNRlPUHUkRI8MPOjWYhE8L QyOxpm8nNzMYNPQjkimsPfMe4nXiHb3iLhKtKZ+rWpPRic5xZUjkkWJSO/ZothHrP+xA2N 0hXHVFmK//fCZwIG8IH5c30iMFZ6mie4+tWjxiHoPRkioJKNfFy94RWqgWRW+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702497993; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ba+6YLXMTxXmjfwLL2u7W6Kb7+Zp8j0sFynPY68HjOg=; b=iNPEhRAmNjcxgmFkaDaGWiaQWHjhv0UAQdXSbmwHDkfsVNGreKQbaq7h62IKZ8bi3qYgsN Rixu3UHapmdI1RNK9hdJCnbiKS5pVx013vgw9n6TilNWF+pBx4yZFuusrfxOH46bLzUwVD YnzmMg35eyt/nchnH/ZfImzt+ketVktZqEvSWVrkKZmMuv9KX6r9gZQLSXYmh6fFFAu/6i 977ABRehYiuAZaQIlZZzsyIO+TQmnJbsiwuli8k757LLae7onZeZ/XFYW1nnd0Olrs78HR Onfqns9J8g4W/k2OZxvaUXzP8j9Tif/179wGWlYaulWsUjXYWRsdl2Bm0joIMQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Sr6213yfcz1BBr; Wed, 13 Dec 2023 20:06:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BDK6X7W087571; Wed, 13 Dec 2023 20:06:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BDK6XYF087568; Wed, 13 Dec 2023 20:06:33 GMT (envelope-from git) Date: Wed, 13 Dec 2023 20:06:33 GMT Message-Id: <202312132006.3BDK6XYF087568@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: 58073ccbe358 - stable/13 - tail: Verify correct behavior when input does not end in a newline. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 58073ccbe358ecc0c470b9b6d767bcfcf5e5292e Auto-Submitted: auto-generated The branch stable/13 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=58073ccbe358ecc0c470b9b6d767bcfcf5e5292e commit 58073ccbe358ecc0c470b9b6d767bcfcf5e5292e Author: Dag-Erling Smørgrav AuthorDate: 2023-03-16 15:36:49 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-12-13 16:39:38 +0000 tail: Verify correct behavior when input does not end in a newline. Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D39116 (cherry picked from commit fa3af3ce5010740f28faed22e0a1e819491f26b4) --- usr.bin/tail/tests/tail_test.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/usr.bin/tail/tests/tail_test.sh b/usr.bin/tail/tests/tail_test.sh index 0b845dff0cf8..8123a310fe67 100755 --- a/usr.bin/tail/tests/tail_test.sh +++ b/usr.bin/tail/tests/tail_test.sh @@ -391,6 +391,19 @@ si_number_body() { atf_check cmp outfile expectfile } +atf_test_case no_lf_at_eof +no_lf_at_eof_head() +{ + atf_set "descr" "File does not end in newline" +} +no_lf_at_eof_body() +{ + printf "a\nb\nc" >infile + atf_check -o inline:"c" tail -1 infile + atf_check -o inline:"b\nc" tail -2 infile + atf_check -o inline:"a\nb\nc" tail -3 infile + atf_check -o inline:"a\nb\nc" tail -4 infile +} atf_init_test_cases() { @@ -415,4 +428,5 @@ atf_init_test_cases() atf_add_test_case silent_header atf_add_test_case verbose_header atf_add_test_case si_number + atf_add_test_case no_lf_at_eof }