diff options
Diffstat (limited to 'main_tests.lua')
-rw-r--r-- | main_tests.lua | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/main_tests.lua b/main_tests.lua index 98cc73d..7b5c4e8 100644 --- a/main_tests.lua +++ b/main_tests.lua @@ -1,8 +1,8 @@ function test_resize_window() io.write('\ntest_resize_window') - Filename = 'foo' - App.screen.init{width=Margin_left+300, height=300} - check_eq(App.screen.width, Margin_left+300, 'F - test_resize_window/baseline/width') + Editor_state.filename = 'foo' + App.screen.init{width=Editor_state.margin_left+300, height=300} + check_eq(App.screen.width, Editor_state.margin_left+300, 'F - test_resize_window/baseline/width') check_eq(App.screen.height, 300, 'F - test_resize_window/baseline/height') App.resize(200, 400) check_eq(App.screen.width, 200, 'F - test_resize_window/width') @@ -12,7 +12,7 @@ end function test_drop_file() io.write('\ntest_drop_file') - App.screen.init{width=Margin_left+300, height=300} + App.screen.init{width=Editor_state.margin_left+300, height=300} App.filesystem['foo'] = 'abc\ndef\nghi\n' local fake_dropped_file = { opened = false, @@ -31,18 +31,18 @@ function test_drop_file() end, } App.filedropped(fake_dropped_file) - check_eq(#Lines, 3, 'F - test_drop_file/#lines') - check_eq(Lines[1].data, 'abc', 'F - test_drop_file/lines:1') - check_eq(Lines[2].data, 'def', 'F - test_drop_file/lines:2') - check_eq(Lines[3].data, 'ghi', 'F - test_drop_file/lines:3') + check_eq(#Editor_state.lines, 3, 'F - test_drop_file/#lines') + check_eq(Editor_state.lines[1].data, 'abc', 'F - test_drop_file/lines:1') + check_eq(Editor_state.lines[2].data, 'def', 'F - test_drop_file/lines:2') + check_eq(Editor_state.lines[3].data, 'ghi', 'F - test_drop_file/lines:3') end function test_drop_file_saves_previous() io.write('\ntest_drop_file_saves_previous') - App.screen.init{width=Margin_left+300, height=300} + App.screen.init{width=Editor_state.margin_left+300, height=300} -- initially editing a file called foo that hasn't been saved to filesystem yet - Lines = load_array{'abc', 'def'} - Filename = 'foo' + Editor_state.lines = load_array{'abc', 'def'} + Editor_state.filename = 'foo' schedule_save() -- now drag a new file bar from the filesystem App.filesystem['bar'] = 'abc\ndef\nghi\n' |