1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2017-09-20 19:45:19 +00:00
parent 812d5040ea
commit cf475b86fc
5 changed files with 48 additions and 25 deletions

View file

@ -0,0 +1,10 @@
require File.expand_path('../../../spec_helper', __FILE__)
require 'date'
describe "Date#next_day" do
it "returns the next day" do
d = Date.new(2000, 1, 5)
d1 = Date.new(2000, 1, 4).next_day
d1.should == d
end
end

View file

@ -2,6 +2,8 @@ require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../shared/include', __FILE__)
require 'set'
describe "Set#===" do
it_behaves_like :set_include, :===
ruby_version_is "2.5" do
describe "Set#===" do
it_behaves_like :set_include, :===
end
end

View file

@ -2,6 +2,8 @@ require File.expand_path('../../../../spec_helper', __FILE__)
require File.expand_path('../shared/include', __FILE__)
require 'set'
describe "SortedSet#===" do
it_behaves_like :sorted_set_include, :===
ruby_version_is "2.5" do
describe "SortedSet#===" do
it_behaves_like :sorted_set_include, :===
end
end

View file

@ -13,10 +13,11 @@ extern "C" {
#endif
#ifdef HAVE_RB_ST
# if SIZEOF_LONG == SIZEOF_VOIDP
# define ST2NUM(x) ULONG2NUM(x)
#if SIZEOF_LONG == SIZEOF_VOIDP
# define ST2NUM(x) ULONG2NUM(x)
#else
# define ST2NUM(x) ULL2NUM(x)
# define ST2NUM(x) ULL2NUM(x)
#endif
VALUE st_spec_st_init_numtable(VALUE self) {

View file

@ -55,25 +55,8 @@ def compile_extension(name)
$stderr.puts output if debug
end
make = ENV['MAKE']
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
if File.basename(make, ".*").casecmp?("nmake")
# suppress logo of nmake.exe to stderr
ENV["MAKEFLAGS"] = "l#{ENV["MAKEFLAGS"]}"
end
opts = {}
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"]
begin
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
rescue Errno::EBADF
else
opts[r] = r
opts[w] = w
end
end
# Do not capture stderr as we want to show compiler warnings
make, opts = setup_make
output = IO.popen([make, "V=1", "DESTDIR=", opts], &:read)
raise "#{make} failed:\n#{output}" unless $?.success?
$stderr.puts output if debug
@ -88,6 +71,31 @@ def compile_extension(name)
lib
end
def setup_make
make = ENV['MAKE']
make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make")
make_flags = ENV["MAKEFLAGS"] || ''
# suppress logo of nmake.exe to stderr
if File.basename(make, ".*").downcase == "nmake" and !make_flags.include?("l")
ENV["MAKEFLAGS"] = "l#{make_flags}"
end
opts = {}
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ make_flags
begin
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
rescue Errno::EBADF
else
opts[r] = r
opts[w] = w
end
end
[make, opts]
end
def load_extension(name)
require compile_extension(name)
rescue LoadError