Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Sep 5, 2024
1 parent 30fa159 commit 1a15f3f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion test/irb/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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; '#<A>'; end
Expand All @@ -139,6 +140,9 @@ def b; true; end
.b
.itself
EOC
sleep 0.2
write ''
sleep 0.2
close
assert_screen(<<~EOC)
start IRB
Expand Down Expand Up @@ -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; '#<A>'; end
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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")
Expand All @@ -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

Expand Down

0 comments on commit 1a15f3f

Please sign in to comment.