summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomoya ishida <tomoyapenguin@gmail.com>2024-03-24 21:54:33 +0900
committergit <svn-admin@ruby-lang.org>2024-03-24 12:54:40 +0000
commit82f4cff1f39d5f2c762f8cf61f079e318066e44e (patch)
tree26205acb9ac4095e8ceeaa4f6197d3ed72b63766
parentb0eda83ee0c34d265277635a1e13591d6367bd01 (diff)
[ruby/irb] Fix indent test for new reline
(https://github.com/ruby/irb/pull/908) https://github.com/ruby/irb/commit/7c16ce033e
-rw-r--r--test/irb/test_irb.rb7
-rw-r--r--test/irb/yamatanooroti/test_rendering.rb26
2 files changed, 16 insertions, 17 deletions
diff --git a/test/irb/test_irb.rb b/test/irb/test_irb.rb
index 8c4fb5ddee..966c840135 100644
--- a/test/irb/test_irb.rb
+++ b/test/irb/test_irb.rb
@@ -70,11 +70,8 @@ module TestIRB
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"
- )
+ assert_not_match(/irb\(main\):001> (\r*\n)?=> nil/, output)
+ assert_match(/irb\(main\):002> (\r*\n)?=> nil/, output)
end
end
diff --git a/test/irb/yamatanooroti/test_rendering.rb b/test/irb/yamatanooroti/test_rendering.rb
index 511df58ea6..df4ec01a5c 100644
--- a/test/irb/yamatanooroti/test_rendering.rb
+++ b/test/irb/yamatanooroti/test_rendering.rb
@@ -137,6 +137,7 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
a
.a
.b
+ .itself
EOC
close
assert_screen(<<~EOC)
@@ -153,9 +154,10 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
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
@@ -181,7 +183,6 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
(a)
&.b()
-
class A def b; self; end; def c; true; end; end;
a = A.new
a
@@ -190,6 +191,7 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
.c
(a)
&.b()
+ .itself
EOC
close
assert_screen(<<~EOC)
@@ -214,17 +216,17 @@ class IRB::RenderingTest < Yamatanooroti::TestCase
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