mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 15:20:15 +00:00
Test ipairs()
This commit is contained in:
parent
2eaf56f359
commit
b14c6fc831
@ -30,8 +30,14 @@ do
|
||||
assert(cb[2] == b.cels[2])
|
||||
assert(cb[3] == b.cels[3])
|
||||
|
||||
s:deleteCel(cb[2])
|
||||
local i = 1
|
||||
for k,v in ipairs(b.cels) do
|
||||
assert(i == k)
|
||||
assert(v == b.cels[k])
|
||||
i = i+1
|
||||
end
|
||||
|
||||
s:deleteCel(cb[2])
|
||||
assert(cb[1] == b.cels[1])
|
||||
assert(cb[3] == b.cels[2])
|
||||
end
|
||||
|
@ -20,6 +20,13 @@ do
|
||||
assert(a.frames[1].duration == 0.1)
|
||||
assert(a.frames[2].duration == 0.2)
|
||||
|
||||
local i = 1
|
||||
for k,v in ipairs(a.frames) do
|
||||
assert(i == k)
|
||||
assert(v == a.frames[k])
|
||||
i = i+1
|
||||
end
|
||||
|
||||
a:deleteFrame(1)
|
||||
assert(a.frames[1].duration == 0.2)
|
||||
end
|
||||
|
@ -16,6 +16,13 @@ do
|
||||
assert(s.layers[2] == b)
|
||||
assert(s.layers[3] == c)
|
||||
|
||||
local i = 1
|
||||
for k,v in ipairs(s.layers) do
|
||||
assert(i == k)
|
||||
assert(v == s.layers[k])
|
||||
i = i+1
|
||||
end
|
||||
|
||||
s:deleteLayer(b)
|
||||
assert(#s.layers == 2)
|
||||
assert(s.layers[1] == a)
|
||||
|
@ -13,6 +13,13 @@ do
|
||||
assert(b.bounds == Rectangle(0, 2, 8, 10))
|
||||
assert(c.bounds == Rectangle(0, 0, 32, 32))
|
||||
|
||||
local i = 1
|
||||
for k,v in ipairs(s.slices) do
|
||||
assert(i == k)
|
||||
assert(v == s.slices[k])
|
||||
i = i+1
|
||||
end
|
||||
|
||||
s:deleteSlice(b)
|
||||
assert(a == s.slices[1])
|
||||
assert(c == s.slices[2])
|
||||
|
@ -20,6 +20,13 @@ do
|
||||
assert(b == s.tags[2])
|
||||
assert(c == s.tags[3])
|
||||
|
||||
local i = 1
|
||||
for k,v in ipairs(s.tags) do
|
||||
assert(i == k)
|
||||
assert(v == s.tags[k])
|
||||
i = i+1
|
||||
end
|
||||
|
||||
s:deleteTag(b)
|
||||
assert(a == s.tags[1])
|
||||
assert(c == s.tags[2])
|
||||
|
Loading…
Reference in New Issue
Block a user