bugfix: get tests to pass

This commit is contained in:
Kartik K. Agaram 2022-07-26 09:55:42 -07:00
parent 2b3c621fe7
commit c8efd91060
2 changed files with 8 additions and 4 deletions

View File

@ -13,6 +13,8 @@ record those here.
graphics printed to screen, but not the precise pixels they translate to.
- where exactly the cursor is drawn to highlight a given character
* Logging files created in the 'recent' file.
### Other compromises
Lua is dynamically typed. Tests can't patch over lack of type-checking.

View File

@ -49,10 +49,12 @@ function save_to_disk(State)
end
outfile:close()
if not State.recent_updated then
local f = io.open(State.directory..'recent', 'a')
if f then
f:write(State.file_path, '\n')
f:close()
if State.file_path then -- might not be set in some tests from lines.love that I don't want to modify in capture.love; we don't want to touch the file system then anyway
local f = io.open(State.directory..'recent', 'a')
if f then
f:write(State.file_path, '\n')
f:close()
end
end
State.recent_updated = true
end