summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cram/lua/test_cases/set_with_empty_table_doesnt_leak.lua2
-rw-r--r--tests/cram/test_ucilua_testcases.t7
2 files changed, 9 insertions, 0 deletions
diff --git a/tests/cram/lua/test_cases/set_with_empty_table_doesnt_leak.lua b/tests/cram/lua/test_cases/set_with_empty_table_doesnt_leak.lua
new file mode 100644
index 0000000..83e91d3
--- /dev/null
+++ b/tests/cram/lua/test_cases/set_with_empty_table_doesnt_leak.lua
@@ -0,0 +1,2 @@
+local c = uci.cursor(os.getenv("CONFIG_DIR"))
+print(pcall(c.set, c, "network", "lan", "dns", {}))
diff --git a/tests/cram/test_ucilua_testcases.t b/tests/cram/test_ucilua_testcases.t
index 279dfce..6a0216b 100644
--- a/tests/cram/test_ucilua_testcases.t
+++ b/tests/cram/test_ucilua_testcases.t
@@ -8,3 +8,10 @@ check that changes method doesnt leak memory:
$ cp -R "$TESTDIR/config" .
$ export CONFIG_DIR=$(pwd)/config
$ ucilua $TESTDIR/lua/test_cases/changes_doesnt_leak.lua
+
+check that set method with empty table value doesn't leak memory:
+
+ $ cp -R "$TESTDIR/config" .
+ $ export CONFIG_DIR=$(pwd)/config
+ $ ucilua $TESTDIR/lua/test_cases/set_with_empty_table_doesnt_leak.lua
+ false\tCannot set an uci option to an empty table value (esc)