seattlerb / ruby_parser

ruby_parser is a ruby parser written in pure ruby. It outputs s-expressions which can be manipulated and converted back to ruby via the ruby2ruby gem.
http://www.zenspider.com/projects/ruby_parser.html
476 stars 100 forks source link

Many tests are failing with 3.20 (passed with 3.19 in same environment) #336

Closed pravi closed 1 year ago

pravi commented 1 year ago

Many tests fail like this,

 35) Failure:
TestRubyParserV32#test_if_pre_not__18 [/usr/lib/ruby/vendor_ruby/pt_testcase.rb:159]:
failed on input: "if not b then a end".
--- expected
+++ actual
@@ -1 +1,4 @@
-s(:if, s(:call, nil, :b), nil, s(:call, nil, :a))
+s(:if,
+ s(:call, s(:call, nil, :b).line(1), :!).line(1),
+ s(:call, nil, :a).line(1),
+ nil).line(1)

ruby version is 3.1

Full log here https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1035307

pravi commented 1 year ago

Following the steps mentioned in #337 and with rvm installed ruby 3.1, I can reproduce the same failure.

pravi commented 1 year ago

All tests pass with ruby 3.0 on debian bullseye, but fail on debian bookworm/sid with ruby 3.1

pravi commented 1 year ago

on debian bullseye also the tests fail with ruby 3.1.

zenspider commented 1 year ago

The tests all pass for me with the following versions both on 3.20.0 and on head:

Passed: 2.7.8, 3.0.6, 3.1.4, 3.2.2
Failed: 

ETA: same with 3.19.2

zenspider commented 1 year ago

aaand same if I gh repo clone seattlerb/ruby_parser in /tmp/ and start from scratch with an empty gemset...

Sorry... but there's no reproduction steps here with which to get under debug. I can't do much otherwise.

It LOOKS like all your failures are of the __18 variant. If they're coming up looking like 2.0+ variants instead, then you're prolly not using the correct version of the parser somehow

pravi commented 1 year ago

@zenspider the tests are passing with ruby 3.1.4 but failing with ruby 3.1.2! I will ask ruby maintainers in debian to update it.

zenspider commented 1 year ago

Nope:

10006 % ruby -vS rake
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin22]

Run options: --seed 33718

# Running:

...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S..................................................................................................S...........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...........................................................................................S........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...........................................................................................................................................................................................................................................................S..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...............................................................................................................................................................................................................................................................S............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S.............................................................................................S................................................................................................................................................................................................................................................................S...............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S..................................................................................................S.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S...............................................................................................................................................................................................................................................................S....................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S.................................................................................................S.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................S.................................................................................................S.............................................................................................................................................................................................................................................................................S........................................................................................................................................................................................................................................................................S......................................................................................................................................................................................................................................................................................................................................................................................................................................................

Finished in 1.328530s, 7926.0536 runs/s, 30099.4332 assertions/s.

10530 runs, 39988 assertions, 0 failures, 0 errors, 22 skips

You have skipped tests. Run with --verbose for details.
pravi commented 1 year ago

Ah, then it is some other gem in debian sid/bookworm causing this.

pravi commented 1 year ago

This was caused by sexp_processor 4.16.1, after updating it to 4.17.0, the tests are passing.