1 _T
= require('lua_lldb_test').create_test('TestFileHandle')
3 function _T
:TestLegacyFileOutScript()
4 local f
= io
.open(self
.output
, 'w')
5 local sbf
= lldb
.SBFile(f
)
6 self
.debugger
:SetOutputFile(sbf
)
7 self
:handle_command('script print(1+1)')
8 self
.debugger
:GetOutputFileHandle():write('FOO\n')
9 self
.debugger
:GetOutputFileHandle():flush()
12 f
= io
.open(self
.output
, 'r')
13 assertEqual(read_file_non_empty_lines(f
), {'2', 'FOO'})
17 function _T
:TestLegacyFileOut()
18 local f
= io
.open(self
.output
, 'w')
19 local sbf
= lldb
.SBFile(f
)
20 self
.debugger
:SetOutputFile(sbf
)
21 self
:handle_command('expression/x 3735928559', false)
24 f
= io
.open(self
.output
, 'r')
25 assertStrContains(f
:read('*l'), 'deadbeef')
29 function _T
:TestLegacyFileErr()
30 local f
= io
.open(self
.output
, 'w')
31 local sbf
= lldb
.SBFile(f
)
32 self
.debugger
:SetErrorFile(sbf
)
33 self
:handle_command('lol', false)
36 f
= io
.open(self
.output
, 'r')
37 assertStrContains(f
:read('*l'), 'is not a valid command')