Skip to content

Commit

Permalink
Fix indent test and output sequence test for new reline
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Mar 22, 2024
1 parent 3c6d452 commit ab7a9c6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
9 changes: 4 additions & 5 deletions test/irb/test_irb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ def test_empty_input_echoing_behaviour
type "exit"
end

# Input cramped together due to how Reline's Reline::GeneralIO works
assert_include(
output,
"irb(main):001> irb(main):002> irb(main):002> irb(main):002> => nil\r\n"
)
# Ignore ANSI color codes
output = output.gsub(/\e\[[\d;]*m/, '')
assert_not_match(/irb\(main\):001> (\r*\n)?=> nil/, output)
assert_match(/irb\(main\):002> (\r*\n)?=> nil/, output)
end
end

Expand Down
26 changes: 14 additions & 12 deletions test/irb/yamatanooroti/test_rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def b; true; end
a
.a
.b
.itself
EOC
close
assert_screen(<<~EOC)
Expand All @@ -153,9 +154,10 @@ def b; true; end
irb(main):008>
irb(main):009> a
irb(main):010> .a
irb(main):011> .b
irb(main):011> .b
irb(main):012> .itself
=> true
irb(main):012>
irb(main):013>
EOC
end

Expand All @@ -181,7 +183,6 @@ def c; true; end
(a)
&.b()
class A def b; self; end; def c; true; end; end;
a = A.new
a
Expand All @@ -190,6 +191,7 @@ class A def b; self; end; def c; true; end; end;
.c
(a)
&.b()
.itself
EOC
close
assert_screen(<<~EOC)
Expand All @@ -214,17 +216,17 @@ class A def b; self; end; def c; true; end; end;
irb(main):015> &.b()
=> #<A>
irb(main):016>
irb(main):017>
irb(main):018> class A def b; self; end; def c; true; end; end;
irb(main):019> a = A.new
irb(main):017> class A def b; self; end; def c; true; end; end;
irb(main):018> a = A.new
=> #<A>
irb(main):020> a
irb(main):021> .b
irb(main):022> # aaa
irb(main):023> .c
irb(main):019> a
irb(main):020> .b
irb(main):021> # aaa
irb(main):022> .c
=> true
irb(main):024> (a)
irb(main):025> &.b()
irb(main):023> (a)
irb(main):024> &.b()
irb(main):025> .itself
=> #<A>
irb(main):026>
EOC
Expand Down

0 comments on commit ab7a9c6

Please sign in to comment.