]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: optstr: test redundant commas
authorCole Robinson <crobinso@redhat.com>
Fri, 17 Oct 2025 15:11:38 +0000 (11:11 -0400)
committerCole Robinson <crobinso@redhat.com>
Fri, 17 Oct 2025 15:11:38 +0000 (11:11 -0400)
optstr, used for parsing mount option lists, eats leading,
trailing, and duplicated commas, but I can't find any test coverage
for that behavior.

Amend the existing optstr test to hit all the cases I can think of

Signed-off-by: Cole Robinson <crobinso@redhat.com>
tests/ts/misc/optstr

index edc2f4cf1f280bcd521b768077c9e06a2ebcbce7..9277a8f4b6d035a507a45aeaa8ea83aa613c447c 100755 (executable)
@@ -8,7 +8,7 @@ ts_init "$*"
 
 ts_check_test_command "$TS_HELPER_STRUTILS"
 
-$TS_HELPER_STRUTILS --optstr "key=\"v,a,l,u,e\",foo,bar=BAR,\"/path/with/,comma\"=data" >> $TS_OUTPUT 2>> $TS_ERRLOG
+$TS_HELPER_STRUTILS --optstr ",,key=\"v,a,l,u,e\",foo,,,,bar=BAR,\"/path/with/,comma\"=data,," >> $TS_OUTPUT 2>> $TS_ERRLOG
 
 ts_finalize