diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2023-11-30 17:10:40 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-01-11 13:44:01 +0000 |
| commit | 1ed3b6037566cef3d56e882eb0fcf1b14553f540 (patch) | |
| tree | 0aff22917c79cb6dd5e475dcb59050fd4a257953 /test | |
| parent | 62382a434561b6fe56d479b8800cf6ccf017463c (diff) | |
[ruby/pp] Fix pretty printing a Data subclass instance when the subclass is anonymous
* It would be "#<data a=42>" (double space) instead of "#<data a=42>" (like #inspect).
https://github.com/ruby/pp/commit/bed72bfcb8
Diffstat (limited to 'test')
| -rw-r--r-- | test/test_pp.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_pp.rb b/test/test_pp.rb index d7cca82a00..72a4f127f3 100644 --- a/test/test_pp.rb +++ b/test/test_pp.rb @@ -149,6 +149,9 @@ class PPCycleTest < Test::Unit::TestCase 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)) + + b = Data.define(:a).new(42) + assert_equal("#{b.inspect}\n", PP.pp(b, ''.dup)) end end |
