From 23bd9110ddd2af5f5ef83314022c019928a639d3 Mon Sep 17 00:00:00 2001 From: ell <77150506+ellraiser@users.noreply.github.com> Date: Thu, 29 Feb 2024 09:54:49 +0000 Subject: [PATCH] add callback variant for love.graphics.captureScreenshot --- testing/tests/graphics.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/tests/graphics.lua b/testing/tests/graphics.lua index ae4079382..bc338b94d 100644 --- a/testing/tests/graphics.lua +++ b/testing/tests/graphics.lua @@ -1550,6 +1550,11 @@ love.test.graphics.captureScreenshot = function(test) -- need to wait until end of the frame for the screenshot test:assertNotNil(love.filesystem.openFile('example-screenshot.png', 'r')) love.filesystem.remove('example-screenshot.png') + -- test callback version + love.graphics.captureScreenshot(function (idata) + test:assertNotEquals(nil, idata, 'check we have image data') + end) + test:waitFrames(10) end