summaryrefslogtreecommitdiff
path: root/test/test_pp.rb
diff options
context:
space:
mode:
authormanga_osyo <manga.osyo@gmail.com>2022-10-10 12:30:35 +0900
committergit <svn-admin@ruby-lang.org>2022-10-14 21:31:24 +0900
commit7b7e5153e81288fe57ae64f2e1db228435156aeb (patch)
tree1a8b210186518f1e0ed41f220f75676273c7b277 /test/test_pp.rb
parent5ccb625fbbd1e774636a9fdbe0bf1c3d38e085d5 (diff)
downloadruby-7b7e5153e81288fe57ae64f2e1db228435156aeb.tar.gz
[ruby/pp] [Feature #19045] Add support Data#pretty_print
https://github.com/ruby/pp/commit/343a20d721
Diffstat (limited to 'test/test_pp.rb')
-rw-r--r--test/test_pp.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test_pp.rb b/test/test_pp.rb
index 9cef555d79..4fcb8df4b0 100644
--- a/test/test_pp.rb
+++ b/test/test_pp.rb
@@ -152,6 +152,15 @@ class PPCycleTest < Test::Unit::TestCase
assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
end
+ if "3.2" <= RUBY_VERSION
+ D = Data.define(:aaa, :bbb)
+ def test_data
+ a = D.new("aaa", "bbb")
+ assert_equal("#<data PPTestModule::PPCycleTest::D\n aaa=\"aaa\",\n bbb=\"bbb\">\n", PP.pp(a, ''.dup, 20))
+ assert_equal("#{a.inspect}\n", PP.pp(a, ''.dup))
+ end
+ end
+
def test_object
a = Object.new
a.instance_eval {@a = a}