Skip to content

Commit

Permalink
Truffle debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
ohler55 committed Aug 16, 2023
1 parent 7c95d34 commit 9361a3e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions ext/oj/dump_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,11 +896,7 @@ void oj_dump_compat_val(VALUE obj, int depth, Out out, bool as_ok) {
if (0 < out->argc) {
set_state_depth(*out->argv, depth);
}
#ifdef TRUFFLERUBY
rb_raise(rb_eArgError, "Too deeply nested.");
#else
raise_json_err("Too deeply nested", "NestingError");
#endif
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion test/json_gem/json_common_interface_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def test_dump
too_deep = '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]'
assert_equal too_deep, JSON.dump(eval(too_deep))
assert_kind_of String, Marshal.dump(eval(too_deep))
assert_raise(ArgumentError) { JSON.dump(eval(too_deep), 100) }
assert_raise(ArgumentError) { JSON.dump(eval(too_deep), 10) } # TBD change back to 100 after truffle test
assert_raise(ArgumentError) { Marshal.dump(eval(too_deep), 100) }
assert_equal too_deep, JSON.dump(eval(too_deep), 101)
assert_kind_of String, Marshal.dump(eval(too_deep), 101)
Expand Down

0 comments on commit 9361a3e

Please sign in to comment.