Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
34 additions
and 0 deletions.
- +1 −0 .gitignore
- +33 −0 test/truffle/test_methods_parity.rb
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -66,6 +66,7 @@ target | ||
test/prawn | ||
test/rails | ||
test/testapp/testapp | ||
test/truffle/*.methods | ||
tool/nailgun/Makefile | ||
tool/nailgun/config.log | ||
tool/nailgun/config.status | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,33 @@ | ||
=begin | ||
Run first with JRuby+Truffle, then with MRI: | ||
$ .../jruby -X+T test_methods_parity.rb > truffle.methods | ||
$ .../ruby test_methods_parity.rb truffle.methods > mri.methods | ||
Compare with: | ||
$ git diff -U10 --no-index mri.methods truffle.methods | ||
Red is what we don't implement yet, | ||
Green is methods not existing in MRI (which should be fixed!) | ||
=end | ||
|
||
start = BasicObject # Numeric | ||
|
||
modules = Object.constants.sort.map { |c| | ||
Object.const_get(c) | ||
}.select { |v| | ||
Module === v and !v.instance_methods(false).empty? | ||
}.select { |mod| | ||
!mod.name.end_with?("Error") | ||
}.select { |mod| | ||
mod <= start | ||
} | ||
|
||
if RUBY_ENGINE == "ruby" and truffle_file = ARGV.first | ||
truffle_modules = File.readlines(truffle_file).map(&:chomp).grep(/^[A-Z]/) | ||
modules = modules.select { |mod| truffle_modules.include? mod.name } | ||
end | ||
|
||
modules.each do |mod| | ||
puts | ||
puts mod.name | ||
puts mod.instance_methods(false).sort | ||
end |