Skip to content

Commit

Permalink
Patch set_backtrace tests for new signature
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Dec 18, 2024
1 parent 5c23a96 commit 39da99b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/src/test/java/org/jruby/test/TestRuby.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public void testPrintErrorShouldPrintErrorMessageAndStacktraceWhenBacktraceIsPre
RubyException exception = (RubyException)context.runtime.getClass("NameError").newInstance(context, new IRubyObject[]{ newString(context, "A message")}, Block.NULL_BLOCK);
RubyString[] lines = new RubyString[] { newString(context, "Line 1"), newString(context, "Line 2") };
RubyArray backtrace = RubyArray.newArray(ruby, Arrays.<IRubyObject>asList(lines));
exception.set_backtrace(backtrace);
exception.set_backtrace(context, backtrace);
ruby.printError(exception);
assertEquals("Line 1: A message (NameError)\n\tfrom Line 2\n", CRLFToNL(err.toString()));
}
Expand Down
6 changes: 3 additions & 3 deletions core/src/test/java/org/jruby/test/TestRubyException.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ public void testPrintBacktrace() {
}

public void testPrintNilBacktrace() {
exception.set_backtrace(context.nil);
exception.set_backtrace(context, context.nil);

String[] lines = printError();

assertEquals(0, lines.length);
}

public void testPrintBackTraceWithString() {
exception.set_backtrace(RubyArray.newArray(runtime, newString(context, testLine(0))));
exception.set_backtrace(context, RubyArray.newArray(runtime, newString(context, testLine(0))));

String[] lines = printError();

Expand All @@ -122,7 +122,7 @@ private void setBackTrace(int lineCount) {
for (int i=0; i<lineCount; i++) {
traceLines.add(newString(context, testLine(i)));
}
exception.set_backtrace(RubyArray.newArray(runtime, traceLines));
exception.set_backtrace(context, RubyArray.newArray(runtime, traceLines));
}

private String expectedTraceLine(int index) {
Expand Down

0 comments on commit 39da99b

Please sign in to comment.