mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 14:14:36 +00:00
updated tests to reflect that tablex shallow and deep copy don't copy non-table values
This commit is contained in:
parent
213ba5df0f
commit
6969a044a3
@ -20,10 +20,6 @@ local function test_shallow_copy()
|
|||||||
x = { a = { b = { 2 }, c = { 3 }, } }
|
x = { a = { b = { 2 }, c = { 3 }, } }
|
||||||
r = tablex.shallow_copy(x)
|
r = tablex.shallow_copy(x)
|
||||||
assert:equal(r.a, x.a)
|
assert:equal(r.a, x.a)
|
||||||
|
|
||||||
x = 10
|
|
||||||
r = tablex.shallow_copy(x)
|
|
||||||
assert:equal(r, x)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function test_deep_copy()
|
local function test_deep_copy()
|
||||||
@ -39,10 +35,6 @@ local function test_deep_copy()
|
|||||||
assert(r.a ~= x.a)
|
assert(r.a ~= x.a)
|
||||||
assert:equal(r.a.b[1], 2)
|
assert:equal(r.a.b[1], 2)
|
||||||
assert:equal(r.a.c[1], 3)
|
assert:equal(r.a.c[1], 3)
|
||||||
|
|
||||||
x = 10
|
|
||||||
r = tablex.deep_copy(x)
|
|
||||||
assert:equal(r, x)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user