Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5d6ddf88631c
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bd74834ba443
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Jul 6, 2017

  1. Copy the full SHA
    fa58c30 View commit details
  2. Copy the full SHA
    bef778a View commit details
  3. Copy the full SHA
    bf7eb4d View commit details
  4. Copy the full SHA
    bd74834 View commit details
Original file line number Diff line number Diff line change
@@ -341,6 +341,9 @@ private void userNewCommon(IRubyObject value, DynamicMethod method) throws IOExc
} else {
marshaled = value.callMethod(runtime.getCurrentContext(), "marshal_dump");
}
if (marshaled.getMetaClass() == value.getMetaClass()) {
throw runtime.newRuntimeError("marshal_dump returned same class instance");
}
dumpObject(marshaled);
}

8 changes: 4 additions & 4 deletions lib/ruby/stdlib/date.rb
Original file line number Diff line number Diff line change
@@ -824,7 +824,7 @@ def self.ordinal(y=-4712, d=1, sg=ITALY)
#
# +sg+ specifies the Day of Calendar Reform.
def self.civil(y=-4712, m=1, d=1, sg=ITALY)
if Fixnum === y and Fixnum === m and Fixnum === d and d > 0
if Integer === y and Integer === m and Integer === d and d > 0
m += 13 if m < 0
y -= 1 if y <= 0 and sg > 0 # TODO
begin
@@ -1700,9 +1700,9 @@ def self.civil(y=-4712, m=1, d=1, h=0, min=0, s=0, of=0, sg=ITALY)
of = Rational(zone_to_diff(of) || 0, 86400)
end

if Fixnum === y and Fixnum === m and Fixnum === d and
Fixnum === h and Fixnum === min and
(Fixnum === s or (Rational === s and 1000 % s.denominator == 0)) and
if Integer === y and Integer === m and Integer === d and
Integer === h and Integer === min and
(Integer === s or (Rational === s and 1000 % s.denominator == 0)) and
m > 0 and d > 0 and h >= 0 and h < 24 and min >= 0 and s >= 0
y -= 1 if y <= 0 and sg > 0 # TODO
ms = 0
1 change: 1 addition & 0 deletions test/mri/excludes/Rational_Test.rb
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
exclude :test_coerce2, "needs investigation"
exclude :test_conv, "needs investigation"
exclude :test_marshal, "needs investigation"
exclude :test_power_overflow, "consumes much time and memory on JVM"
exclude :test_power_of_0, "needs investigation"
exclude :test_power_of_1_and_minus_1, "needs investigation"
exclude :test_ratsub, "needs investigation"
6 changes: 3 additions & 3 deletions test/mri/excludes/TestGc.rb
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@
exclude :test_singleton_method_added, "broken subprocess logic"
exclude :test_start_full_mark, ""
exclude :test_start_immediate_sweep, ""
exclude :test_stat_single, ""
exclude :test_stat, "tests count_objects"
exclude :test_stat_constraints, ""
exclude :test_stat_single, ""
exclude :test_sweep_in_finalizer, ""
exclude :test_verify_internal_consistency, ""
exclude :test_stat_constraints, ""
exclude :test_verify_internal_consistency, ""
1 change: 1 addition & 0 deletions test/mri/excludes/TestIO.rb
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
exclude :test_dup_many, "needs investigation"
exclude :test_each_line_limit_0, "needs investigation"
exclude :test_fcntl_dupfd, "needs investigation"
exclude :test_io_select_with_many_files, "creates too many files that break the rest of the suite"
exclude :test_puts_recursive_ary, "needs investigation"
exclude :test_read_lock, "needs investigation"
exclude :test_readlines_limit_0, "needs investigation"
12 changes: 10 additions & 2 deletions test/mri/lib/test/unit/assertions.rb
Original file line number Diff line number Diff line change
@@ -471,11 +471,19 @@ def prepare_syntax_check(code, fname = caller_locations(2, 1)[0], mesg = fname.t
$VERBOSE = verbose
end

def check_syntax(src, filename, line)
if defined? RubyVM::InstructionSequence
RubyVM::InstructionSequence.compile(src, filename, filename, line)
else
eval src, binding, filename, line
end
end

def assert_valid_syntax(code, *args)
prepare_syntax_check(code, *args) do |src, fname, line, mesg|
yield if defined?(yield)
assert_nothing_raised(SyntaxError, mesg) do
RubyVM::InstructionSequence.compile(src, fname, fname, line)
check_syntax(src, fname, line)
end
end
end
@@ -484,7 +492,7 @@ def assert_syntax_error(code, error, *args)
prepare_syntax_check(code, *args) do |src, fname, line, mesg|
yield if defined?(yield)
e = assert_raise(SyntaxError, mesg) do
RubyVM::InstructionSequence.compile(src, fname, fname, line)
check_syntax(src, fname, line)
end
assert_match(error, e.message, mesg)
end