mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-09-03 02:47:56 +00:00
Petty changes because I'm petty
This commit is contained in:
@@ -388,14 +388,14 @@ function create( parent, nX, nY, nWidth, nHeight, bStartVisible )
|
|||||||
return nBackgroundColor
|
return nBackgroundColor
|
||||||
end
|
end
|
||||||
|
|
||||||
function window.getLine( nY )
|
function window.getLine(y)
|
||||||
if type(nY) ~= "number" then expect(1, nY, "number") end
|
if type(y) ~= "number" then expect(1, y, "number") end
|
||||||
|
|
||||||
if nY < 1 or nY > nHeight then
|
if y < 1 or y > nHeight then
|
||||||
error( "Line is out of range.", 2 )
|
error("Line is out of range.", 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
return tLines[nY].text, tLines[nY].textColor, tLines[nY].backgroundColor
|
return tLines[y].text, tLines[y].textColor, tLines[y].backgroundColor
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Other functions
|
-- Other functions
|
||||||
|
@@ -130,5 +130,11 @@ describe("The window library", function()
|
|||||||
expect.error(w.getLine, 0):eq("Line is out of range.")
|
expect.error(w.getLine, 0):eq("Line is out of range.")
|
||||||
expect.error(w.getLine, y + 1):eq("Line is out of range.")
|
expect.error(w.getLine, y + 1):eq("Line is out of range.")
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("provides a line's contents", function()
|
||||||
|
local w = mk()
|
||||||
|
w.blit("test", "aaaa", "4444")
|
||||||
|
expect({ w.getLine(1) }):same { "test ", "aaaa0", "4444f" }
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user