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)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0656715806E for ; Wed, 7 Jun 2023 11:13:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 26C43E088A; Wed, 7 Jun 2023 11:13:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 0C6CDE088A for ; Wed, 7 Jun 2023 11:13:40 +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 EDBAF340D40 for ; Wed, 7 Jun 2023 11:13:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C7266A8E for ; Wed, 7 Jun 2023 11:13:36 +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: <1686136373.12eedb30ca60f0a7ae781b845d7bc22cc1b3267f.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: 12eedb30ca60f0a7ae781b845d7bc22cc1b3267f X-VCS-Branch: master Date: Wed, 7 Jun 2023 11:13:36 +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: f3ce143a-e08a-4fa2-8c99-11021a261937 X-Archives-Hash: bf2108f44dcab63efd751cfc3b934e3b commit: 12eedb30ca60f0a7ae781b845d7bc22cc1b3267f Author: Kerin Millar plushkava net> AuthorDate: Mon Jun 5 03:01:43 2023 +0000 Commit: Sam James gentoo org> CommitDate: Wed Jun 7 11:12:53 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=12eedb30 test-functions: Add a test for the _is_visible() function Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> test-functions | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test-functions b/test-functions index 72b5cae..b80587b 100755 --- a/test-functions +++ b/test-functions @@ -240,6 +240,26 @@ test_is_int() { iterate_tests 2 "$@" } +test_is_visible() { + set -- \ + 1 '' \ + 1 ' ' \ + 1 "$(printf '\t')" \ + 1 "$(printf '\a')" \ + 0 . \ + 0 ' . ' \ + 0 "$(printf '\t.\t')" \ + 0 "$(printf '\a.\a')" + + callback() { + shift + test_description="_is_visible $(print_args "$@")" + _is_visible "$@" + } + + iterate_tests 2 "$@" +} + test_yesno() { set -- \ 0 yes \ @@ -344,6 +364,7 @@ test_get_bootparam || rc=1 test_esyslog || rc=1 test_is_identifier || rc=1 test_is_int || rc=1 +test_is_visible || rc=1 test_yesno || rc=1 cleanup_tmpdir exit "${rc}"