6 class TestLLDBInit < Test::Unit::TestCase
7 def assert_rp(expr, pattern, message=nil)
8 Tempfile.create('lldb') do |tf|
10 target create ./miniruby
11 command script import -r misc/lldb_cruby.py
17 o, s = Open3.capture2('lldb', '-b', '-s', tf.path)
18 assert_true s.success?, message
19 assert_match /^\(lldb\) rp obj\n#{pattern}/, o, message
24 assert_rp 'Object.new', 'T_OBJECT'
28 assert_rp '/foo/', '[(]Regex'
32 assert_rp ':abcde', /T_SYMBOL: \(\h+\)/
36 assert_rp '"abc"', /\(char \[\d+\]\) ary = "abc"/
37 assert_rp "\"\u3042\"", /\(char \[\d+\]\) ary = "\u3042"/
38 assert_rp '"' + "\u3042"*10 + '"', /\(RString::\(anonymous struct\)\) heap = \{/