@@ -44,6 +44,9 @@ empty =
4444multi = foo1
4545multi = foo2
4646
47+ [key_with_spaces]
48+ rgw special key = something
49+
4750# inidelete(a)
4851[del_separate_options]
4952a=b
8285
8386# test iniget_sections
8487VAL=$( iniget_sections " ${TEST_INI} " )
85- assert_equal " $VAL " " default aaa bbb ccc ddd eee del_separate_options \
86- del_same_option del_missing_option del_missing_option_multi del_no_options"
88+ assert_equal " $VAL " " default aaa bbb ccc ddd eee key_with_spaces \
89+ del_separate_options del_same_option del_missing_option \
90+ del_missing_option_multi del_no_options"
8791
8892# Test with missing arguments
8993BEFORE=$( cat ${TEST_INI} )
@@ -209,6 +213,20 @@ iniset $SUDO_ARG ${INI_TMP_ETC_DIR}/test.new.ini test foo bar
209213VAL=$( iniget ${INI_TMP_ETC_DIR} /test.new.ini test foo)
210214assert_equal " $VAL " " bar" " iniset created file"
211215
216+ # test creation of keys with spaces
217+ iniset ${SUDO_ARG} ${TEST_INI} key_with_spaces " rgw another key" somethingelse
218+ VAL=$( iniget ${TEST_INI} key_with_spaces " rgw another key" )
219+ assert_equal " $VAL " " somethingelse" " iniset created a key with spaces"
220+
221+ # test update of keys with spaces
222+ iniset ${SUDO_ARG} ${TEST_INI} key_with_spaces " rgw special key" newvalue
223+ VAL=$( iniget ${TEST_INI} key_with_spaces " rgw special key" )
224+ assert_equal " $VAL " " newvalue" " iniset updated a key with spaces"
225+
226+ inidelete ${SUDO_ARG} ${TEST_INI} key_with_spaces " rgw another key"
227+ VAL=$( iniget ${TEST_INI} key_with_spaces " rgw another key" )
228+ assert_empty VAL " inidelete removed a key with spaces"
229+
212230$SUDO rm -rf ${INI_TMP_DIR}
213231
214232report_results
0 commit comments