mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
progresswidget(fix): ignore nil self.last
This commit is contained in:
18
spec/unit/widget_progresswidget_spec.lua
Normal file
18
spec/unit/widget_progresswidget_spec.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
describe("ProgressWidget widget", function()
|
||||
local ProgressWidget, Screen
|
||||
setup(function()
|
||||
require("commonrequire")
|
||||
ProgressWidget = require("ui/widget/progresswidget")
|
||||
Screen = require("device").screen
|
||||
end)
|
||||
|
||||
it("should not crash with nil self.last #ok", function()
|
||||
local progress = ProgressWidget:new{
|
||||
width = 100,
|
||||
height = 50,
|
||||
percentage = 5/100,
|
||||
ticks = {1},
|
||||
}
|
||||
progress:paintTo(Screen.bb, 0, 0)
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user