1 _T
= require('lua_lldb_test').create_test('TestFileHandle')
3 function _T
:TestLegacyFileOutScript()
4 local f
= io
.open(self
.output
, 'w')
5 self
.debugger
:SetOutputFile(f
)
6 self
:handle_command('script print(1+1)')
7 self
.debugger
:GetOutputFileHandle():write('FOO\n')
8 self
.debugger
:GetOutputFileHandle():flush()
11 f
= io
.open(self
.output
, 'r')
12 assertEquals(read_file_non_empty_lines(f
), {'2', 'FOO'})
16 function _T
:TestLegacyFileOut()
17 local f
= io
.open(self
.output
, 'w')
18 self
.debugger
:SetOutputFile(f
)
19 self
:handle_command('expression/x 3735928559', false)
22 f
= io
.open(self
.output
, 'r')
23 assertStrContains(f
:read('*l'), 'deadbeef')
27 function _T
:TestLegacyFileErr()
28 local f
= io
.open(self
.output
, 'w')
29 self
.debugger
:SetErrorFile(f
)
30 self
:handle_command('lol', false)
32 f
= io
.open(self
.output
, 'r')
33 assertStrContains(f
:read('*l'), 'is not a valid command')