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: f6ed52e0975d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f43d14017ffd
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Mar 24, 2016

  1. Force MRI-style backtraces when using runner to run MRI tests.

    Several tests examine error output, which does not match using our
    normal backtrace style. See #3756.
    headius committed Mar 24, 2016
    Copy the full SHA
    c9a9f5c View commit details
  2. Fix a couple exception messages.

    The "assignment" warning fix almost gets MRI's TestRubyoptions#
    test_assignment_in_conditional, but there's a few cases where we
    differ from MRI in warning output. See #3757.
    headius committed Mar 24, 2016
    Copy the full SHA
    f43d140 View commit details
Showing with 5 additions and 2 deletions.
  1. +2 −2 core/src/main/java/org/jruby/parser/ParserSupport.java
  2. +3 −0 test/mri/runner.rb
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/parser/ParserSupport.java
Original file line number Diff line number Diff line change
@@ -545,11 +545,11 @@ public void checkUselessStatements(BlockNode blockNode) {
**/
private boolean checkAssignmentInCondition(Node node) {
if (node instanceof MultipleAsgnNode) {
lexer.compile_error(PID.MULTIPLE_ASSIGNMENT_IN_CONDITIONAL, "Multiple assignment in conditional.");
lexer.compile_error(PID.MULTIPLE_ASSIGNMENT_IN_CONDITIONAL, "multiple assignment in conditional");
} else if (node instanceof LocalAsgnNode || node instanceof DAsgnNode || node instanceof GlobalAsgnNode || node instanceof InstAsgnNode) {
Node valueNode = ((AssignableNode) node).getValueNode();
if (valueNode instanceof ILiteralNode || valueNode instanceof NilNode || valueNode instanceof TrueNode || valueNode instanceof FalseNode) {
warnings.warn(ID.ASSIGNMENT_IN_CONDITIONAL, node.getPosition(), "Found '=' in conditional, should be '=='.");
warnings.warn(ID.ASSIGNMENT_IN_CONDITIONAL, node.getPosition(), "found = in conditional, should be ==");
}
return true;
}
3 changes: 3 additions & 0 deletions test/mri/runner.rb
Original file line number Diff line number Diff line change
@@ -20,6 +20,9 @@ class Gem::TestCase < MiniTest::Unit::TestCase

ENV["GEM_SKIP"] = ENV["GEM_HOME"] = ENV["GEM_PATH"] = "".freeze

# Use MRI backtraces for tests that verify error output
ENV["JRUBY_OPTS"] += ENV["JRUBY_OPTS"].to_s + " -Xbacktrace.style=mri"

require_relative 'lib/profile_test_all' if ENV.has_key?('RUBY_TEST_ALL_PROFILE')
#require_relative 'lib/tracepointchecker'
require_relative 'lib/zombie_hunter'