From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 374E915810F for ; Sun, 11 Jun 2023 16:47:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 835F5E086F; Sun, 11 Jun 2023 16:47:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 6BB78E086F for ; Sun, 11 Jun 2023 16:47:16 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B1B283413DD for ; Sun, 11 Jun 2023 16:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4D58CA66 for ; Sun, 11 Jun 2023 16:47:14 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1686382927.7f27dfa0ca0969837a9a40df49281ec7a2dae035.sam@gentoo> Subject: [gentoo-commits] proj/gentoo-functions:master commit in: / X-VCS-Repository: proj/gentoo-functions X-VCS-Files: test-functions X-VCS-Directories: / X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 7f27dfa0ca0969837a9a40df49281ec7a2dae035 X-VCS-Branch: master Date: Sun, 11 Jun 2023 16:47:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4ebb2b23-ee3c-4235-a412-b0c0efc2e939 X-Archives-Hash: e8edce6c0448b7bb031dd887c006e1f1 commit: 7f27dfa0ca0969837a9a40df49281ec7a2dae035 Author: Kerin Millar plushkava net> AuthorDate: Sat Jun 10 07:40:16 2023 +0000 Commit: Sam James gentoo org> CommitDate: Sat Jun 10 07:42:07 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=7f27dfa0 test-functions: Add a test for the ebegin() function The test determines whether ebegin() appends at least one character to the message (following the ASCII ellipsis). Signed-off-by: Kerin Millar plushkava.net> test-functions | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test-functions b/test-functions index aed6620..513deb3 100755 --- a/test-functions +++ b/test-functions @@ -68,6 +68,25 @@ test_chdir_noop() { iterate_tests 2 "$@" } +test_ebegin() { + _eprint() { + shift + _ends_with_newline "$*" + ok=$(( $? == 0 )) + } + + ok=0 + set -- "message" + ebegin "$1" + + if [ "${ok}" -eq 0 ]; then + printf 'not ' + fi + printf 'ok %d - ebegin %s (expecting terminating newline)\n' "$((testnum + 1))" "$1" + + return "$(( ok ? 0 : 1 ))" +} + test_is_older_than() { set -- \ 1 N/A N/A \ @@ -451,6 +470,7 @@ rc=0 test_chdir || rc=1 test_chdir_noop || rc=1 +( test_ebegin ) || rc=1; testnum=$((testnum + 1)) test_is_older_than || rc=1 test_get_bootparam || rc=1 test_esyslog || rc=1