commit:     ac7ba4b2801edebb6588dbee7728ab7ae2e7e03d
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Feb  7 06:10:36 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> 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 <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> 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 ))

Reply via email to