wait, fix tests

We had this problem because our test fakes were out of sync with reality.
And just in the source app.
This commit is contained in:
Kartik K. Agaram 2023-05-30 00:24:16 -07:00
parent da21512440
commit e568378ecb
1 changed files with 19 additions and 9 deletions

28
app.lua
View File

@ -316,16 +316,26 @@ end
-- fake files
function App.open_for_writing(filename)
App.filesystem[filename] = ''
return {
write = function(self, ...)
local args = {...}
for i,s in ipairs(args) do
if Current_app == nil or Current_app == 'run' then
return {
write = function(self, ...)
local args = {...}
for i,s in ipairs(args) do
App.filesystem[filename] = App.filesystem[filename]..s
end
end,
close = function(self)
end,
}
elseif Current_app == 'source' then
return {
write = function(self, s)
App.filesystem[filename] = App.filesystem[filename]..s
end
end,
close = function(self)
end,
}
end,
close = function(self)
end,
}
end
end
function App.open_for_reading(filename)