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 3933315800F for ; Tue, 7 Feb 2023 23:43:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5C53AE07C9; Tue, 7 Feb 2023 23:42:59 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 4724FE07C9 for ; Tue, 7 Feb 2023 23:42:59 +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 7D785340E0D for ; Tue, 7 Feb 2023 23:42:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 549028A1 for ; Tue, 7 Feb 2023 23:42:52 +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: <1675813191.ac7ba4b2801edebb6588dbee7728ab7ae2e7e03d.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: ac7ba4b2801edebb6588dbee7728ab7ae2e7e03d X-VCS-Branch: master Date: Tue, 7 Feb 2023 23:42:52 +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: fd1f1dea-b437-4187-a95c-15013127deb7 X-Archives-Hash: 563ba4a84e1c586bed1f31b2b8b77e64 commit: ac7ba4b2801edebb6588dbee7728ab7ae2e7e03d Author: Kerin Millar plushkava net> AuthorDate: Tue Feb 7 06:10:36 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue Feb 7 23:39:51 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=ac7ba4b2 Add some more tests for the get_bootparam() function These additional tests include some that would have easily foiled the old parser, so it seems sensible to have them be included. Signed-off-by: Kerin Millar plushkava.net> Signed-off-by: Sam James gentoo.org> test-functions | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/test-functions b/test-functions index d5816f1..3f34d59 100755 --- a/test-functions +++ b/test-functions @@ -112,14 +112,20 @@ test_is_older_than() { } test_get_bootparam() { + cmdline="foo gentoo=bar,baz quux" set -- \ - 1 N/A "${cmdline:=foo gentoo=bar,baz quux}" \ - 1 '' "${cmdline}" \ - 1 '' "gentoo=" \ - 1 foo "${cmdline}" \ - 0 bar "${cmdline}" \ - 0 baz "${cmdline}" \ - 1 bar,baz "${cmdline}" + 1 N/A "${cmdline}" \ + 1 '' "${cmdline}" \ + 1 '' "gentoo=" \ + 1 foo "${cmdline}" \ + 0 bar "${cmdline}" \ + 0 bar "foo gentoo=gentoo=1,bar baz" \ + 0 bar "foo gentoo=bar,gentoo=1 baz" \ + 0 baz "${cmdline}" \ + 1 bar,baz "${cmdline}" \ + 0 gentoo=1 "foo gentoo=bar,gentoo=1 baz" \ + 0 gentoo=1 "foo gentoo=gentoo=1,bar baz" \ + 1 quux "${cmdline}" passed=0 total=$(( $# / 3 ))