new test: dragging and dropping a file on lines.love

[?]
Jun 30, 2022, 12:52 AM
BPWFKBXTKIRBJFWVZIUVCHGJTLBCR6EIMEHM3D3KOF5IULXCR5RQC

Dependencies

  • [2] CE4LZV4T drop last couple of manual tests

Change contents

  • edit in main_tests.lua at line 13
    [2.552]
    [2.552]
    function test_drop_file()
    io.write('\ntest_drop_file')
    App.screen.init{width=Margin_left+300, height=300}
    App.filesystem['foo'] = 'abc\ndef\nghi\n'
    local fake_dropped_file = {
    opened = false,
    getFilename = function(self)
    return 'foo'
    end,
    open = function(self)
    self.opened = true
    end,
    lines = function(self)
    assert(self.opened)
    return App.filesystem['foo']:gmatch('[^\n]+')
    end,
    close = function(self)
    self.opened = false
    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')
    end