diff --git a/ext/oj/parse.c b/ext/oj/parse.c index 9dbb545b..7144b951 100644 --- a/ext/oj/parse.c +++ b/ext/oj/parse.c @@ -848,6 +848,12 @@ oj_set_error_at(ParseInfo pi, VALUE err_clas, const char* file, int line, const if (p + 3 < end) { *p++ = ' '; *p++ = '('; + *p++ = 'a'; + *p++ = 'f'; + *p++ = 't'; + *p++ = 'e'; + *p++ = 'r'; + *p++ = ' '; start = p; for (vp = pi->stack.head; vp < pi->stack.tail; vp++) { if (end <= p + 1 + vp->klen) { diff --git a/test/sample_obj.json b/test/sample_obj.json index 619f2889..16638f5c 100644 --- a/test/sample_obj.json +++ b/test/sample_obj.json @@ -12,7 +12,7 @@ { "attr1": 12345, "attr2": "a string", - "attr3/Time": 1234567.7777 + "attr3/Time": 1234567.7777, "attr4/Foo::Bar": { "a": "xyz" } diff --git a/test/test_various.rb b/test/test_various.rb index bf02c578..8f5d4dd3 100755 --- a/test/test_various.rb +++ b/test/test_various.rb @@ -671,7 +671,7 @@ def test_error_path raise e end } - assert_equal('first[2].third', msg.split('(')[1].split(')')[0]) + assert_equal('after first[2].third', msg.split('(')[1].split(')')[0]) end def test_bad_bignum