<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/test_pp.rb, branch v4.0.2</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/pp] Suppress warnings in test on Ruby 2.7</title>
<updated>2025-10-05T06:14:00+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-10-05T01:25:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1dd11fe8c8a238ea88f5abbdb673de313a82ede2'/>
<id>1dd11fe8c8a238ea88f5abbdb673de313a82ede2</id>
<content type='text'>
TODO: Revert when dropping Ruby 2.7 support.

https://github.com/ruby/pp/commit/feb417e152
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TODO: Revert when dropping Ruby 2.7 support.

https://github.com/ruby/pp/commit/feb417e152
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Exclude out-of-scope test instead of omitting</title>
<updated>2025-10-05T06:13:57+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2025-10-05T01:03:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=deb9f45229bc32f3c607b001d46092f69f86664f'/>
<id>deb9f45229bc32f3c607b001d46092f69f86664f</id>
<content type='text'>
https://github.com/ruby/pp/commit/40b713d70f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/pp/commit/40b713d70f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Update pp for Set to use new inspect format</title>
<updated>2025-10-05T06:13:56+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2025-10-04T16:06:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ec1655d52019e66725efe94b5bc88b3a98af284e'/>
<id>ec1655d52019e66725efe94b5bc88b3a98af284e</id>
<content type='text'>
(https://github.com/ruby/pp/pull/43)

Ruby 3.5 will use `Set[1, 2, 3]`. This updates pp to use the same format.

https://github.com/ruby/pp/commit/507eebf711
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/pp/pull/43)

Ruby 3.5 will use `Set[1, 2, 3]`. This updates pp to use the same format.

https://github.com/ruby/pp/commit/507eebf711
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Fix ::Data warning on Ruby 2.7</title>
<updated>2025-10-05T06:13:52+00:00</updated>
<author>
<name>Benoit Daloze</name>
<email>eregontp@gmail.com</email>
</author>
<published>2025-10-04T13:30:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=340777078c88478bae1e39b10bd6409491fd584b'/>
<id>340777078c88478bae1e39b10bd6409491fd584b</id>
<content type='text'>
* It was showing on require 'pp':
  lib/pp.rb:525: warning: constant ::Data is deprecated
* Fixes https://github.com/ruby/pp/issues/51

https://github.com/ruby/pp/commit/4fd8f4e0bb
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* It was showing on require 'pp':
  lib/pp.rb:525: warning: constant ::Data is deprecated
* Fixes https://github.com/ruby/pp/issues/51

https://github.com/ruby/pp/commit/4fd8f4e0bb
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Support new instance_variables_to_inspect method from Ruby core</title>
<updated>2025-10-05T06:13:50+00:00</updated>
<author>
<name>Jason Frey</name>
<email>fryguy9@gmail.com</email>
</author>
<published>2025-08-13T17:37:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=80a18e8f422e30204e7386fc9a1fc37667b20b2a'/>
<id>80a18e8f422e30204e7386fc9a1fc37667b20b2a</id>
<content type='text'>
This supports the new `instance_variables_to_inspect` method from Ruby
core that was added in ruby/ruby#13555.

If `instance_variables_to_inspect` is defined, then
`pretty_print_instance_variables` will use it.

Additionally, this commit introduces tests for both
`pretty_print_instance_variables` and `instance_variables_to_inspect`.

https://github.com/ruby/pp/commit/9cea466c95
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This supports the new `instance_variables_to_inspect` method from Ruby
core that was added in ruby/ruby#13555.

If `instance_variables_to_inspect` is defined, then
`pretty_print_instance_variables` will use it.

Additionally, this commit introduces tests for both
`pretty_print_instance_variables` and `instance_variables_to_inspect`.

https://github.com/ruby/pp/commit/9cea466c95
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Ensure the thread local state is always set up.</title>
<updated>2025-02-25T03:38:04+00:00</updated>
<author>
<name>Samuel Williams</name>
<email>samuel.williams@oriontransfer.co.nz</email>
</author>
<published>2025-02-25T03:37:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=021ccbf7e8e34a1ae7af2d8411ed6dc4e5e8f980'/>
<id>021ccbf7e8e34a1ae7af2d8411ed6dc4e5e8f980</id>
<content type='text'>
(https://github.com/ruby/pp/pull/38)

https://github.com/ruby/pp/commit/5b5d483ac2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/pp/pull/38)

https://github.com/ruby/pp/commit/5b5d483ac2
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Fix pretty printing range begin/end with false or nil</title>
<updated>2024-11-19T14:52:01+00:00</updated>
<author>
<name>tompng</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2024-10-09T04:31:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7b51b3c75b503de744b5988619915033a3a9b7ff'/>
<id>7b51b3c75b503de744b5988619915033a3a9b7ff</id>
<content type='text'>
https://github.com/ruby/pp/commit/6d9c0f255a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/pp/commit/6d9c0f255a
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Handle BasicObject</title>
<updated>2024-11-12T02:13:15+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-07-12T10:23:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=83702f7157a8c74dd4d7d6d79dea78d90a7b6570'/>
<id>83702f7157a8c74dd4d7d6d79dea78d90a7b6570</id>
<content type='text'>
Right now attempting to pretty print a BasicObject or any other
object lacking a few core Object methods will result in an error

```
Error: test_basic_object(PPTestModule::PPInspectTest): NoMethodError: undefined method `is_a?' for an instance of BasicObject
lib/pp.rb:192:in `pp'
lib/pp.rb:97:in `block in pp'
lib/pp.rb:158:in `guard_inspect_key'
lib/pp.rb:97:in `pp'
test/test_pp.rb:131:in `test_basic_object'
     128:
     129:   def test_basic_object
     130:     a = BasicObject.new
  =&gt; 131:     assert_match(/\A#&lt;BasicObject:0x[\da-f]+&gt;\n\z/, PP.pp(a, ''.dup))
     132:   end
     133: end
     134:
```

With some fairly small changes we can fallback to `Object#inspect`
which is better than an error.

https://github.com/ruby/pp/commit/4e9f6c2de0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Right now attempting to pretty print a BasicObject or any other
object lacking a few core Object methods will result in an error

```
Error: test_basic_object(PPTestModule::PPInspectTest): NoMethodError: undefined method `is_a?' for an instance of BasicObject
lib/pp.rb:192:in `pp'
lib/pp.rb:97:in `block in pp'
lib/pp.rb:158:in `guard_inspect_key'
lib/pp.rb:97:in `pp'
test/test_pp.rb:131:in `test_basic_object'
     128:
     129:   def test_basic_object
     130:     a = BasicObject.new
  =&gt; 131:     assert_match(/\A#&lt;BasicObject:0x[\da-f]+&gt;\n\z/, PP.pp(a, ''.dup))
     132:   end
     133: end
     134:
```

With some fairly small changes we can fallback to `Object#inspect`
which is better than an error.

https://github.com/ruby/pp/commit/4e9f6c2de0
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/pp] Data#pretty_print handle privated or removed members</title>
<updated>2024-11-12T02:11:43+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2024-11-07T10:47:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=107a4da122126e6d0e0ad12898d7511e472709a3'/>
<id>107a4da122126e6d0e0ad12898d7511e472709a3</id>
<content type='text'>
[Bug #20808]

The previous implementation assumed all members are accessible,
but it's possible for users to change the visibility of members or
to entirely remove the accessor.

https://github.com/ruby/pp/commit/fb19501434
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #20808]

The previous implementation assumed all members are accessible,
but it's possible for users to change the visibility of members or
to entirely remove the accessor.

https://github.com/ruby/pp/commit/fb19501434
</pre>
</div>
</content>
</entry>
<entry>
<title>Make test_hash_symbol_colon_key pass on LANG=en_US</title>
<updated>2024-10-10T03:23:18+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-10-10T02:48:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a985695b9e7f58552cfa6b8700c4dabc137e41e8'/>
<id>a985695b9e7f58552cfa6b8700c4dabc137e41e8</id>
<content type='text'>
It failed on a platform with LANG=en_US
```
  1) Failure:
PPTestModule::PPSingleLineTest#test_hash_symbol_colon_key [/home/chkbuild/chkbuild/tmp/build/20241010T010005Z/ruby/test/test_pp.rb:207]:
&lt;"{a: 1, a!: 1, a?: 1, \u3042: 1}"&gt; expected but was
&lt;"{a: 1, a!: 1, a?: 1, \"\\u3042\": 1}"&gt;.
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It failed on a platform with LANG=en_US
```
  1) Failure:
PPTestModule::PPSingleLineTest#test_hash_symbol_colon_key [/home/chkbuild/chkbuild/tmp/build/20241010T010005Z/ruby/test/test_pp.rb:207]:
&lt;"{a: 1, a!: 1, a?: 1, \u3042: 1}"&gt; expected but was
&lt;"{a: 1, a!: 1, a?: 1, \"\\u3042\": 1}"&gt;.
```
</pre>
</div>
</content>
</entry>
</feed>
