19 Commits
Author SHA1 Message Date
Jean Boussier ee0de3fd4e [ruby/json] JSON.dump: write directly into the provided IO
Ref: https://github.com/ruby/json/issues/524

Rather than to buffer everything in memory.

Unfortunately Ruby doesn't provide an API to write into
and IO without first allocating a string, which is a bit
wasteful.

https://github.com/ruby/json/commit/f017af6c0a
2024-11-26 15:11:05 +09:00
Peter Zhu 64827b15e8 [ruby/json] Fix $VERBOSE restore
Manually sync this commit that was missed.

https://github.com/ruby/json/commit/6ae9155
2024-11-11 15:13:24 -05:00
Jean Boussier 1b6a26e23a [ruby/json] JSON.load_file: explictly load the file as UTF-8
Fix: https://github.com/ruby/json/issues/697

This way even if `Encoding.default_external` is set to a weird value
the document will be parsed just fine.

https://github.com/ruby/json/commit/3a8505a8fa
2024-11-11 09:40:11 +09:00
Jean Boussier ca8f21ace8 [ruby/json] Resync 2024-11-05 18:00:36 +01:00
Étienne BarriéandJean Boussier 82f7550f65 Use frozen string literals
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2024-10-26 18:44:15 +09:00
Jean Boussier 18cc663aef [ruby/json] Add test coverage for JSON.load with a Proc
Fix: https://github.com/ruby/json/issues/438

https://github.com/ruby/json/commit/9dd89eaac8
2024-10-26 18:44:15 +09:00
YuheiNakasaka 57e1b64c81 [ruby/json] Fix behavior of trying to parse non-string objects
https://github.com/ruby/json/commit/e2e9936047
2024-10-18 11:28:13 +09:00
tompng 70740deea7 [flori/json] Fix JSON.dump overload combination
https://github.com/flori/json/commit/41c2712a3b
2023-12-05 12:04:08 +09:00
Takashi Kokubun 96a809f621 Use require_relative in JSON tests
to prevent them from conflicting with yarp/test_helper
2023-08-25 15:32:14 -07:00
Kazuhiro NISHIYAMA ce986b41ca Remove unneeded begin and end 2020-09-30 15:55:07 +09:00
Kazuhiro NISHIYAMA 30bb040ea4 Fix Leaked tempfiles
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
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
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
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
Hiroshi SHIBATA 9eecd7a2fd Ignore warnings about ambiguous first argument of regexp with assert match. 2019-06-01 14:44:24 +03: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