This commit is contained in:
Kartik K. Agaram 2022-09-15 11:26:45 -07:00
parent 9a41c7c176
commit b90a54a9cb
3 changed files with 21 additions and 2 deletions

View File

@ -45,7 +45,7 @@ function source.initialize_globals()
index = 1,
}
Menu_status_bar_height = nil -- initialized below
Menu_status_bar_height = 5 + --[[line height in tests]] 15 + 5
-- a few text objects we can avoid recomputing unless the font changes
Text_cache = {}

View File

@ -127,7 +127,10 @@ end
function edit.draw(State)
State.button_handlers = {}
App.color(Text_color)
assert(#State.lines == #State.line_cache)
if #State.lines ~= #State.line_cache then
print(('line_cache is out of date; %d when it should be %d'):format(#State.line_cache, #State.lines))
assert(false)
end
if not Text.le1(State.screen_top1, State.cursor1) then
print(State.screen_top1.line, State.screen_top1.pos, State.screen_top1.posB, State.cursor1.line, State.cursor1.pos, State.cursor1.posB)
assert(false)

View File

@ -18,6 +18,22 @@ function test_resize_window()
-- TODO: how to make assertions about when App.update got past the early exit?
end
function test_show_log_browser_side()
io.write('\ntest_show_log_browser_side')
App.screen.init{width=300, height=300}
Editor_state = edit.initialize_test_state()
Editor_state.filename = 'foo'
Text.redraw_all(Editor_state)
Log_browser_state = edit.initialize_test_state()
Text.redraw_all(Log_browser_state)
log_browser.parse(Log_browser_state)
check(not Show_log_browser_side, 'F - test_show_log_browser_side/baseline')
Current_app = 'source'
App.wait_fake_time(0.1)
App.run_after_keychord('C-l')
check(Show_log_browser_side, 'F - test_show_log_browser_side')
end
function test_drop_file()
io.write('\ntest_drop_file')
App.screen.init{width=Editor_state.left+300, height=300}