aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2022-03-18 15:24:12 +0000
committerMatthew Wild <mwild1@gmail.com>2022-03-18 15:24:12 +0000
commit9a1b7e5627a5b5e85ed5c50c18932a9808fd676a (patch)
tree17bdd8a8a8176b7de090faa6b1a8968e71a065e3 /spec
parent22cc92f4376b5a641cdbb337d34b40312972b1e8 (diff)
downloadprosody-9a1b7e5627a5b5e85ed5c50c18932a9808fd676a.tar.gz
prosody-9a1b7e5627a5b5e85ed5c50c18932a9808fd676a.zip
util.table: tests: Tests for table.move()
Diffstat (limited to 'spec')
-rw-r--r--spec/util_table_spec.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/util_table_spec.lua b/spec/util_table_spec.lua
index 76f54b69..a0535c08 100644
--- a/spec/util_table_spec.lua
+++ b/spec/util_table_spec.lua
@@ -12,6 +12,17 @@ describe("util.table", function ()
assert.same({ "lorem", "ipsum", "dolor", "sit", "amet", n = 5 }, u_table.pack("lorem", "ipsum", "dolor", "sit", "amet"));
end);
end);
+
+ describe("move()", function ()
+ it("works", function ()
+ local t1 = { "apple", "banana", "carrot" };
+ local t2 = { "cat", "donkey", "elephant" };
+ local t3 = {};
+ u_table.move(t1, 1, 3, 1, t3);
+ u_table.move(t2, 1, 3, 3, t3);
+ assert.same({ "apple", "banana", "cat", "donkey", "elephant" }, t3);
+ end);
+ end);
end);