test/settings.lua: fix the assert failure in the callback API tests

The callback for the last test was getting called with non-string type and this
fails the test. fix it by sending string in correct format.

This test failure was not failing the "make test" this is known limitation in the test
setup. The limitation here is only with the last assert statement.
This commit is contained in:
Ashok Sidipotu 2022-08-23 21:35:04 +05:30 committed by Julian Bouzas
parent 72536261e9
commit b172ae915f

View file

@ -221,7 +221,7 @@ function callback (obj, s, rawvalue)
assert (s == setting)
callback = true
assert (json:parse() == setting_value)
assert (setting_value == Settings.get (s, "test-settings")):parse()
assert (setting_value == Settings.get (s, "test-settings"):parse())
end
if (finish_activation) then
@ -270,7 +270,7 @@ metadata_om:connect("objects-changed", function (om)
callback = false
finish_activation = true
metadata:set(0, setting, "Spa:String:JSON", setting_value)
metadata:set(0, setting, "Spa:String:JSON", "\"lets not blabber\"")
assert (callback)
end)