From d55b9994bd78793191c618df7c634b16c704ac88 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 1 Dec 2022 22:13:18 +0000 Subject: [PATCH] Remove debug command related yamatanooroti tests As discussed in https://github.com/ruby/irb/pull/449#pullrequestreview-1187255149, we should avoid adding new tests that need yamatanooroti because it's not maintained by the Ruby org. And since debug commands are now tested in `test/irb/test_debug_cmd.rb`, we don't need these tests anymore. --- test/irb/yamatanooroti/test_rendering.rb | 221 ----------------------- 1 file changed, 221 deletions(-) diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb index 6d1a0a1d7..09e3313ca 100644 --- a/test/irb/yamatanooroti/test_rendering.rb +++ b/test/irb/yamatanooroti/test_rendering.rb @@ -237,234 +237,13 @@ def test_assignment_expression_truncate EOC end - def test_debug - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - puts "Hello" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("debug\n") - write("next\n") - close - assert_include_screen(<<~EOC) - (rdbg) next # command - [1, 3] in #{@ruby_file} - 1| puts "start IRB" - 2| binding.irb - => 3| puts "Hello" - EOC - end - - def test_break - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - puts "Hello" - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("break 3\n") - write("continue\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) break 3 - #0 BP - Line #{@ruby_file}:3 (line) - EOC - assert_include_screen(<<~EOC) - (rdbg) continue # command - [1, 4] in #{@ruby_file} - 1| puts "start IRB" - 2| binding.irb - => 3| puts "Hello" - 4| puts "World" - =>#0
at #{@ruby_file}:3 - - Stop by #0 BP - Line #{@ruby_file}:3 (line) - EOC - end - - def test_delete - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - puts "Hello" - binding.irb - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("break 5\n") - write("continue\n") - write("delete 0\n") - close - assert_include_screen(<<~EOC.strip) - (rdbg:irb) delete 0 - deleted: #0 BP - Line - EOC - end - - def test_next - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - puts "Hello" - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("next\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) next - [1, 4] in #{@ruby_file} - 1| puts "start IRB" - 2| binding.irb - => 3| puts "Hello" - 4| puts "World" - =>#0
at #{@ruby_file}:3 - EOC - end - - def test_step - write_ruby <<~'RUBY' - puts "start IRB" - def foo - puts "Hello" - end - binding.irb - foo - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("step\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) step - [1, 7] in #{@ruby_file} - 1| puts "start IRB" - 2| def foo - => 3| puts "Hello" - 4| end - 5| binding.irb - EOC - end - - def test_continue - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - puts "Hello" - binding.irb - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("continue\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) continue - Hello - - From: #{@ruby_file} @ line 4 : - - 1: puts "start IRB" - 2: binding.irb - 3: puts "Hello" - => 4: binding.irb - 5: puts "World" - EOC - end - - def test_finish - write_ruby <<~'RUBY' - puts "start IRB" - def foo - binding.irb - puts "Hello" - end - foo - puts "World" - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("finish\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) finish - Hello - [1, 7] in #{@ruby_file} - 1| puts "start IRB" - 2| def foo - 3| binding.irb - 4| puts "Hello" - => 5| end - 6| foo - EOC - end - - def test_backtrace - write_ruby <<~'RUBY' - puts "start IRB" - def foo - binding.irb - end - foo - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("backtrace\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) backtrace - =>#0 Object#foo at #{@ruby_file}:3 - #1
at #{@ruby_file}:5 - EOC - end - - def test_info - write_ruby <<~'RUBY' - puts "start IRB" - a = 1 - binding.irb - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("info\n") - close - assert_include_screen(<<~EOC) - (rdbg:irb) info - %self = main - a = 1 - EOC - end - - def test_catch - write_ruby <<~'RUBY' - puts "start IRB" - binding.irb - raise NotImplementedError - RUBY - start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@ruby_file}}, startup_message: 'start IRB') - write("catch NotImplementedError\n") - write("continue\n") - close - assert_include_screen(<<~EOC) - Stop by #0 BP - Catch "NotImplementedError" - EOC - end - private - def assert_include_screen(expected) - assert_include(result.join("\n"), expected) - end - def write_irbrc(content) File.open(@irbrc_file, 'w') do |f| f.write content end end - - def write_ruby(content) - File.open(@ruby_file, 'w') do |f| - f.write content - end - end end rescue LoadError, NameError # On Ruby repository, this test suit doesn't run because Ruby repo doesn't