summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2019-07-17 10:35:59 +0900
committerGitHub <[email protected]>2019-07-17 10:35:59 +0900
commit5eef75b678b41249cf4738ef42889090caea2ab0 (patch)
tree774fc0de56002abb3bb2b1c3387ff08f91876d17 /test
parent9af3b7c6258de327218dd04e69d76ae68caf17b1 (diff)
parentd605b72c1d6fa4564a0a5e88535504b6850463b5 (diff)
downloadmruby-5eef75b678b41249cf4738ef42889090caea2ab0.tar.gz
mruby-5eef75b678b41249cf4738ef42889090caea2ab0.zip
Merge pull request #4034 from i110/i110/inspect-recursion
Let inspect recursion do the right thing
Diffstat (limited to 'test')
-rw-r--r--test/t/array.rb3
-rw-r--r--test/t/hash.rb2
2 files changed, 4 insertions, 1 deletions
diff --git a/test/t/array.rb b/test/t/array.rb
index 3df99056f..eec31d751 100644
--- a/test/t/array.rb
+++ b/test/t/array.rb
@@ -346,11 +346,12 @@ end
assert('Array#to_s', '15.2.12.5.31 / 15.2.12.5.32') do
a = [2, 3, 4, 5]
+ a[4] = a
r1 = a.to_s
r2 = a.inspect
assert_equal(r2, r1)
- assert_equal("[2, 3, 4, 5]", r1)
+ assert_equal("[2, 3, 4, 5, [...]]", r1)
end
assert('Array#==', '15.2.12.5.33') do
diff --git a/test/t/hash.rb b/test/t/hash.rb
index 156991f4a..cd47d251d 100644
--- a/test/t/hash.rb
+++ b/test/t/hash.rb
@@ -352,11 +352,13 @@ end
assert('Hash#inspect') do
h = { "c" => 300, "a" => 100, "d" => 400, "c" => 300 }
+ h["recur"] = h
ret = h.to_s
assert_include ret, '"c"=>300'
assert_include ret, '"a"=>100'
assert_include ret, '"d"=>400'
+ assert_include ret, '"recur"=>{...}'
end
assert('Hash#rehash') do