Граф коммитов

105 Коммитов

Автор SHA1 Сообщение Дата
Ethan b2cc74a50d [flori/json] test parsing of unicode, mixing literal characters with escaped
https://github.com/flori/json/commit/82fe866da2
2022-07-29 19:10:10 +09:00
Andrew Bromwich a15d0e267a
[flori/json] Fix parser bug for empty string allocation
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to
pass through a null pointer to `rb_enc_interned_str` resulting
in a segfault

Fixes #495

https://github.com/flori/json/commit/b59368a8c2
2022-05-20 17:49:13 +09:00
Charles Oliver Nutter a37051ef3b
[flori/json] Remove unknown keyword arg from DateTime.parse
This snuck in while addding tests for the `create_additions`
feature. Caught by JRuby when we added the `limit` option to the
Date/DateTime parsing methods, which causes this to be rejected as
an unknown keyword.

https://github.com/flori/json/commit/b1007dff66
2022-05-20 17:49:13 +09:00
Hiroshi SHIBATA edb76e8765 Prepare to release json-2.5.0 2020-12-22 19:44:27 +09:00
Kenta Murata 14d7d1df25
[json] Make json Ractor safe 2020-12-21 22:10:43 +09:00
Kenta Murata 98cc15ed1e
[json] Stop using prototype objects 2020-12-21 22:10:33 +09:00
Hiroshi SHIBATA b06ffce4ae
SortedSet was removed at a3db08d7b6 2020-12-04 19:36:12 +09:00
Yusuke Endoh 762be87759 test/json/json_parser_test.rb: suppress warnings
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20201021T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:227: warning: ambiguous first argument; put parentheses or a space even after `-' operator
/home/chkbuild/chkbuild/tmp/build/20201021T123003Z/ruby/test/json/json_parser_test.rb:228: warning: ambiguous first argument; put parentheses or a space even after `-' operator
```
2020-10-21 23:37:42 +09:00
Nobuyoshi Nakada d915e7ee00
strip trailing spaces [ci skip] 2020-10-20 23:52:19 +09:00
Chris Seaton 451836f582
Fix an issue with generate_pretty and empty objects in the Ruby and Java implementations 2020-10-20 21:46:54 +09:00
Jean Boussier 520e0916af
Implement a freeze: parser option
If set to true all parsed objects will be
immediately frozen, and strings will be
deduplicated if the Ruby implementation
allows it.
2020-10-20 21:40:25 +09:00
Kazuhiro NISHIYAMA ce986b41ca
Remove unneeded `begin` and `end` 2020-09-30 15:55:07 +09:00
Kazuhiro NISHIYAMA 30bb040ea4
Fix `Leaked tempfile`s
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20200930T033004Z.diff.html.gz
```
 [n/n] JSONCommonInterfaceTest#test_load = <elapsed> s
 [n/n] JSONCommonInterfaceTest#test_load_file = <elapsed> s
+Leaked tempfile: JSONCommonInterfaceTest#test_load_file: #<Tempfile:<build-dir>/tmp/20200930-7601-ptnv6i (closed)>
 [n/n] JSONCommonInterfaceTest#test_load_file! = <elapsed> s
+Leaked tempfile: JSONCommonInterfaceTest#test_load_file!: #<Tempfile:<build-dir>/tmp/20200930-7601-1la6m9 (closed)>
 [n/n] JSONCommonInterfaceTest#test_load_file_with_option = <elapsed> s
+Leaked tempfile: JSONCommonInterfaceTest#test_load_file_with_option: #<Tempfile:<build-dir>/tmp/20200930-7601-blf9hz (closed)>
 [n/n] JSONCommonInterfaceTest#test_load_file_with_option! = <elapsed> s
+Leaked tempfile: JSONCommonInterfaceTest#test_load_file_with_option!: #<Tempfile:<build-dir>/tmp/20200930-7601-b5gsdb (closed)>
```
2020-09-30 15:41:14 +09:00
Kazuhiro NISHIYAMA ac414139ec
Remove unnecessary executable bit [ci skip] 2020-09-28 23:07:43 +09:00
Yusuke Endoh e4b2c4fca5 t/json/json_common_interface_test.rb: fix wrong indentation
to prevent:

```
test/json/json_common_interface_test.rb:182: warning: mismatched indentations at 'end' with 'def' at 169
```
2020-09-25 23:37:12 +09:00
Hiroshi SHIBATA 6eeacbbc36
Extract assert assertion to assert_include and assert_not_include. 2020-09-25 20:28:31 +09:00
Hiroshi SHIBATA 81dc37b1b4 assert_true is not provided by test-unit 2020-09-25 17:28:42 +09:00
Marc-Andre Lafortune e30d1b0923 Fix pure parser with unclosed arrays / objects [Fix #314] 2020-09-25 17:28:42 +09:00
Karol Bucek 0089854fc5 [test] properly 'skip' test on JRuby
an early return still caused ensure to execute,
setting JSON constant to `nil` for later tests!
2020-09-25 17:28:42 +09:00
Keith Bennett c3614877d2 [flori/json] Add `load_file` and `load_file!` methods, with tests. Fixes issue #386.
https://github.com/flori/json/commit/0be363c99b
2020-09-25 17:28:42 +09:00
Jean Boussier e1659af372 Add an option to escape forward slash character
Squashed commit of the following:

commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Tue Sep 15 21:17:34 2015 +0000

    add config options for escape_slash

commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date:   Mon Feb 9 21:09:33 2015 +0000

    add forward slash to escape character
2020-09-25 17:28:42 +09:00
Yusuke Endoh 1e039474a2 test/json/json_fixtures_test.rb: Prevent an "out of range" warning
```
/home/mame/work/ruby/.ext/common/json/common.rb:263: warning: Float 23456789012E666 out of range
```
2020-07-03 11:47:09 +09:00
Yusuke Endoh e6a8590aa4 Reintroduce c565dfb09a 2020-07-03 11:05:08 +09:00
Hiroshi SHIBATA 0aac138e0b
Merge json-2.3.1 from flori/json 2020-07-01 18:50:39 +09:00
Marc-Andre Lafortune fe10323a35
[flori/json] Fix test that wasn't testing anything
https://github.com/flori/json/commit/d5c6566b41
2020-07-01 18:47:51 +09:00
Yusuke Endoh c565dfb09a test/json/test_helper.rb: Do not add a relative path to $LOAD_PATH
... because it conflicts with test/ruby/test_m17n.rb.

An exception `incompatible character encodings: UTF-8 and UTF-16BE`
occurs when:

* a non-existence relative path is added to $LOAD_PATH,
* ASCII-incompatible encoding is set to default_external, and
* some file is loaded.

```
$LOAD_PATH << "no_existing_dir"
Encoding.default_external = Encoding::UTF_16BE
load "dummy.rb" #=> incompatible character encodings: UTF-8 and UTF-16BE
```

This issue can be actually observed by a combination of out-of-place
build and the following command:

make test-all TESTS="json ruby/m17n -n test_object_inspect_external"

http://ci.rvm.jp/logfiles/brlog.trunk-test-random.20200322-221411

ASCII-incompatible default external encoding assumes that the cwd is the
encoding, and it is attempted to beconcatenated with a non-existence
relative LOAD_PATH UTF-8 string, which causes the exception.

This changeset avoids a relative path.
2020-03-24 10:45:52 +09:00
Hiroshi SHIBATA 53e8589c69
Import json-2.3.0 from flori/json 2019-12-12 09:14:09 +09:00
Nobuyoshi Nakada f83bebdf7a
Skip useless test
`JSONGeneratorTest#test_remove_const_seg` is meaningful only for
the extension library version, but nonsense for pure ruby version.
2019-11-29 11:21:38 +09:00
Aaron Patterson 9026e12f93
Look up constant instead of caching in a global
The global can go bad if the compactor runs, so we need to look up the
constant instead of caching it in a global.
2019-10-17 13:30:09 -07:00
Florian Frank a4cf11c10f
[flori/json] fix test as reported in #343
https://github.com/flori/json/commit/565c72ba9e
2019-10-14 19:54:49 +09:00
Nobuyoshi Nakada 2003755a2c
[flori/json] Fixed unexpected illegal/malformed utf-8 error
flori/json@c34d01ff6a does not
consider US-ASCII compatible but non-UTF-8 encodings, and causes
an error in RDoc tests.

https://github.com/flori/json/commit/4f471bf590
2019-10-14 19:54:48 +09:00
Hiroshi SHIBATA 3c77ef9adc
Ignore warnings about ambiguous first argument with the negative integer. 2019-06-01 15:07:35 +03:00
Hiroshi SHIBATA 9eecd7a2fd
Ignore warnings about ambiguous first argument of regexp with assert match. 2019-06-01 14:44:24 +03:00
hsbt 6604e1b7cd Merge json-2.2.0 from flori/json.
https://github.com/flori/json/releases/tag/v2.2.0

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-02-23 03:43:58 +00:00
mrkn a7e3516ff1 Fix JSON::Parser against bigdecimal updates
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66127 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-12-02 05:21:57 +00:00
ko1 ab8e756de0 require 'bigdecimal'
* test/json/json_parser_test.rb: this test needs bigdecimal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-16 04:04:53 +00:00
hsbt b304078ae6 Merge json-2.1.0 from https://github.com/flori/json
https://github.com/flori/json/blob/master/CHANGES.md#2017-04-18-210

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-06-16 03:04:46 +00:00
hsbt d9df358ea8 Use `assert_raise` instead of `assert_raises`.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 00:21:20 +00:00
hsbt 83735ba29a Merge json-2.0.4.
* https://github.com/flori/json/releases/tag/v2.0.4
  * 09fabeb03e/CHANGES.md (2017-03-23-204)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-12 00:21:18 +00:00
nobu 7f6410f02d json_generator_test.rb: no Bignum
* test/json/json_generator_test.rb (test_broken_bignum): get rid
  of use of Bignum, obsolete name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-09 09:27:38 +00:00
hsbt 11a94f2a36 * ext/json/*, test/json/json_parser_test.rb: Update json-2.0.2.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-08-01 03:16:30 +00:00
hsbt bdda54c064 * test/json/json_common_interface_test.rb: use assert_raise instead of
assert_raises.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13 13:27:08 +00:00
hsbt a7b5d45466 * test/lib/test/unit.rb: added test files with `_test` suffix for json
upstream.
* test/json: merge original test files from json upstream.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13 13:27:07 +00:00
hsbt 1130658738 * ext/json/*, test/json/*: Update json-2.0.1.
Changes of 2.0.0: f679ebd0c6/CHANGES.md (2015-09-11-200)
  Changes of 2.0.1: f679ebd0c6/CHANGES.md (2016-07-01-201)
  [Feature #12542][ruby-dev:49706][fix GH-1395]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 11:49:39 +00:00
akr 449fbfd4d4 Use Integer instead of Fixnum and Bignum.
* object.c, numeric.c, enum.c, ext/-test-/bignum/mul.c,
  lib/rexml/quickpath.rb, lib/rexml/text.rb, lib/rexml/xpath_parser.rb,
  lib/rubygems/specification.rb, lib/uri/generic.rb,
  bootstraptest/test_eval.rb, basictest/test.rb,
  test/-ext-/bignum/test_big2str.rb, test/-ext-/bignum/test_div.rb,
  test/-ext-/bignum/test_mul.rb, test/-ext-/bignum/test_str2big.rb,
  test/csv/test_data_converters.rb, test/date/test_date.rb,
  test/json/test_json_generate.rb, test/minitest/test_minitest_mock.rb,
  test/openssl/test_cipher.rb, test/rexml/test_jaxen.rb,
  test/ruby/test_array.rb, test/ruby/test_basicinstructions.rb,
  test/ruby/test_bignum.rb, test/ruby/test_case.rb,
  test/ruby/test_class.rb, test/ruby/test_complex.rb,
  test/ruby/test_enum.rb, test/ruby/test_eval.rb,
  test/ruby/test_iseq.rb, test/ruby/test_literal.rb,
  test/ruby/test_math.rb, test/ruby/test_module.rb,
  test/ruby/test_numeric.rb, test/ruby/test_range.rb,
  test/ruby/test_rational.rb, test/ruby/test_refinement.rb,
  test/ruby/test_rubyvm.rb, test/ruby/test_struct.rb,
  test/ruby/test_variable.rb, test/rubygems/test_gem_specification.rb,
  test/thread/test_queue.rb: Use Integer instead of Fixnum and Bignum.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-17 13:15:57 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
When you change this to true, you may need to add more tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16 05:07:31 +00:00
nobu 068f312a7c use assert_raise
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-30 04:37:13 +00:00
nobu 4d059bf9f5 generator.c: allocate structs with wrapper
* ext/json/generator/generator.c (cState_s_allocate): allocate
  structs with making new wrapper objects and get rid of potential
  memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50661 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28 07:17:55 +00:00
nobu cbf902fc33 parser.rl: allocate structs with wrapper
* ext/json/parser/parser.rl (cJSON_parser_s_allocate): allocate
  structs with making new wrapper objects and get rid of potential
  memory leak.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-28 07:17:42 +00:00
nobu b38c0b7974 parser.rl: rb_enc_raise
* ext/json/parser/parser.rl: raise with messages in UTF-8
  encoding.  [ruby-core:67386] [Bug #10705]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-04-18 06:19:52 +00:00