From 9361a3eda94a9c4a7a30210ad91578741640f062 Mon Sep 17 00:00:00 2001 From: Peter Ohler Date: Tue, 15 Aug 2023 20:27:10 -0400 Subject: [PATCH] Truffle debugging --- ext/oj/dump_compat.c | 4 ---- test/json_gem/json_common_interface_test.rb | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ext/oj/dump_compat.c b/ext/oj/dump_compat.c index 36d6160a..ea3f11c6 100644 --- a/ext/oj/dump_compat.c +++ b/ext/oj/dump_compat.c @@ -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 } diff --git a/test/json_gem/json_common_interface_test.rb b/test/json_gem/json_common_interface_test.rb index b98c8002..3eae9c27 100755 --- a/test/json_gem/json_common_interface_test.rb +++ b/test/json_gem/json_common_interface_test.rb @@ -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)