From b172ae915f7bebfe95a4e6866bcab293d932b50d Mon Sep 17 00:00:00 2001 From: Ashok Sidipotu Date: Tue, 23 Aug 2022 21:35:04 +0530 Subject: [PATCH] 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. --- tests/wplua/scripts/settings.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/wplua/scripts/settings.lua b/tests/wplua/scripts/settings.lua index 510eed74..63e2820b 100644 --- a/tests/wplua/scripts/settings.lua +++ b/tests/wplua/scripts/settings.lua @@ -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)