From 1a15f3fbaabb3c4a71184d738386e468f3d55121 Mon Sep 17 00:00:00 2001 From: tompng Date: Thu, 5 Sep 2024 15:35:17 +0900 Subject: [PATCH] tmp --- Gemfile | 3 ++- test/irb/yamatanooroti/test_rendering.rb | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 3c2efa44d..e93bd8cee 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,8 @@ is_truffleruby = RUBY_DESCRIPTION =~ /truffleruby/ if is_unix && ENV['WITH_VTERM'] gem "vterm", github: "ruby/vterm-gem" - gem "yamatanooroti", github: "ruby/yamatanooroti" + gem "yamatanooroti", github: "tompng/yamatanooroti", branch: 'better_assertion' + # gem "yamatanooroti", path: "../yamatanooroti" end gem "stackprof" if is_unix && !is_truffleruby diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb index 44e07a3a1..77eecf5ec 100644 --- a/test/irb/yamatanooroti/test_rendering.rb +++ b/test/irb/yamatanooroti/test_rendering.rb @@ -125,6 +125,7 @@ def test_multiline_paste puts 'start IRB' LINES start_terminal(25, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + sleep 0.2 write(<<~EOC) class A def inspect; '#'; end @@ -139,6 +140,9 @@ def b; true; end .b .itself EOC + sleep 0.2 + write '' + sleep 0.2 close assert_screen(<<~EOC) start IRB @@ -166,6 +170,7 @@ def test_evaluate_each_toplevel_statement_by_multiline_paste puts 'start IRB' LINES start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + sleep 0.2 write(<<~EOC) class A def inspect; '#'; end @@ -193,6 +198,9 @@ class A def b; self; end; def c; true; end; end; &.b() .itself EOC + sleep 0.2 + write '' + sleep 0.2 close assert_screen(<<~EOC) start IRB @@ -331,9 +339,11 @@ def test_assignment_expression_truncate puts 'start IRB' LINES start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') + sleep 0.2 # Assignment expression code that turns into non-assignment expression after evaluation code = "a /'/i if false; a=1; x=1000.times.to_a#'.size" write(code + "\n") + sleep 0.2 close assert_screen(<<~EOC) start IRB @@ -350,7 +360,7 @@ def test_ctrl_c_is_handled puts 'start IRB' LINES start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{@pwd}/exe/irb}, startup_message: 'start IRB') - # Assignment expression code that turns into non-assignment expression after evaluation + sleep 0.2 write("\C-c") close assert_screen(<<~EOC) @@ -472,9 +482,12 @@ def test_debug_integration_hints_debugger_commands RUBY script.close start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{script.to_path}}, startup_message: 'start IRB') + sleep 0.2 write("debug\n") + sleep 0.2 write("pp 1\n") write("pp 1") + sleep 0.2 close screen = result.join("\n").sub(/\n*\z/, "\n") @@ -497,7 +510,9 @@ def test_debug_integration_doesnt_hint_non_debugger_commands RUBY script.close start_terminal(40, 80, %W{ruby -I#{@pwd}/lib #{script.to_path}}, startup_message: 'start IRB') + sleep 0.2 write("debug\n") + sleep 0.2 write("foo") close