Mercurial > prosody-hg
comparison spec/util_array_spec.lua @ 13247:1bb4aa803b32 0.12
util.array: Fix new() library function
Backport of ffe4adbd2af9 since new was added in the 0.12 branch
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sat, 22 Jul 2023 16:31:05 +0200 |
| parents | 3ae6fa901a8b |
| children |
comparison
equal
deleted
inserted
replaced
| 13219:22763b30e458 | 13247:1bb4aa803b32 |
|---|---|
| 1 local array = require "util.array"; | 1 local array = require "util.array"; |
| 2 describe("util.array", function () | 2 describe("util.array", function () |
| 3 describe("creation", function () | 3 describe("creation", function () |
| 4 describe("new", function () | |
| 5 it("works", function () | |
| 6 local a = array.new({"a", "b", "c"}); | |
| 7 assert.same({"a", "b", "c"}, a); | |
| 8 end); | |
| 9 end); | |
| 10 | |
| 4 describe("from table", function () | 11 describe("from table", function () |
| 5 it("works", function () | 12 it("works", function () |
| 6 local a = array({"a", "b", "c"}); | 13 local a = array({"a", "b", "c"}); |
| 7 assert.same({"a", "b", "c"}, a); | 14 assert.same({"a", "b", "c"}, a); |
| 8 end); | 15 end); |
