2022-06-18 05:24:46 +00:00
|
|
|
function test_resize_window()
|
2022-07-13 22:40:14 +00:00
|
|
|
App.screen.init{width=300, height=300}
|
2022-07-16 05:12:25 +00:00
|
|
|
Editor_state = edit.initialize_test_state()
|
2022-07-12 21:18:50 +00:00
|
|
|
Editor_state.filename = 'foo'
|
2023-01-21 05:42:52 +00:00
|
|
|
check_eq(App.screen.width, 300, 'baseline/width')
|
|
|
|
check_eq(App.screen.height, 300, 'baseline/height')
|
|
|
|
check_eq(Editor_state.left, Test_margin_left, 'baseline/left_margin')
|
|
|
|
check_eq(Editor_state.right, 300 - Test_margin_right, 'baseline/left_margin')
|
2022-06-18 05:24:46 +00:00
|
|
|
App.resize(200, 400)
|
2022-09-07 17:16:24 +00:00
|
|
|
-- ugly; resize switches to real, non-test margins
|
2023-01-21 05:42:52 +00:00
|
|
|
check_eq(App.screen.width, 200, 'width')
|
|
|
|
check_eq(App.screen.height, 400, 'height')
|
|
|
|
check_eq(Editor_state.left, Margin_left, 'left_margin')
|
|
|
|
check_eq(Editor_state.right, 200-Margin_right, 'right_margin')
|
|
|
|
check_eq(Editor_state.width, 200-Margin_left-Margin_right, 'drawing_width')
|
2022-06-18 05:24:46 +00:00
|
|
|
-- TODO: how to make assertions about when App.update got past the early exit?
|
|
|
|
end
|