summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-06-07Fix the test that does not work with libyaml-0.1.7Yusuke Endoh
2021-06-07Do not use YAML module in tests of PsychHiroshi SHIBATA
2021-06-07Use assert_raise instead of assert_raisesHiroshi SHIBATA
2021-06-07test/psych/test_coder.rb: Suppress non-parenthesis warningsYusuke Endoh
http://rubyci.s3.amazonaws.com/debian9/ruby-master/log/20210518T093002Z.log.html.gz ``` /home/chkbuild/chkbuild/tmp/build/20210518T093002Z/ruby/test/psych/test_coder.rb:277: warning: ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator ```
2021-06-07Suppress debug messageNobuyoshi Nakada
2021-05-19Implement YAML.safe_dump to make safe_load more usable.Jean Boussier
In case where Psych is used as a two way serializers, e.g. to serialize some cache or config, it is preferable to have the same restrictions on both load and dump. Otherwise you might dump and persist some objects payloads that you later won't be able to read.
2021-05-17Make the test pass with the old libyamlYusuke Endoh
I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway.
2021-05-17assert_equal accepts an expected value as the first argumentYusuke Endoh
2021-05-13remove deprecated interfaceAaron Patterson
2021-05-13Introduce `Psych.unsafe_load`Aaron Patterson
In future versions of Psych, the `load` method will be mostly the same as the `safe_load` method. In other words, the `load` method won't allow arbitrary object deserialization (which can be used to escalate to an RCE). People that need to load *trusted* documents can use the `unsafe_load` method. This commit introduces the `unsafe_load` method so that people can incrementally upgrade. For example, if they try to upgrade to 4.0.0 and something breaks, they can downgrade, audit callsites, change to `safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0 smoothly.
2021-05-10Merge pull request #475 from whitehat101/feature/dynamic-scalar-seq-styleAaron Patterson
feat: allow scalars and sequences to be styled when dumped
2021-05-10Merge pull request #480 from Shopify/symbolize-name-non-string-keysHiroshi SHIBATA
Fix symbolize_name with non-string keys
2021-05-10Use assert_raise instead of assert_raisesHiroshi SHIBATA
2021-05-10Removed needless platform detectionHiroshi SHIBATA
2021-05-10Import test assertions from ruby/rubyHiroshi SHIBATA
2021-05-10Use pend instead of skipHiroshi SHIBATA
2021-05-10Fixed test-case for NaNHiroshi SHIBATA
2021-05-10Use Ractor constant for ignoreing conditionHiroshi SHIBATA
2021-05-10Use test-unit instead of minitestHiroshi SHIBATA
2021-02-25Fix symabolize_name with non-string keysJean Boussier
2021-02-15Fix custom marshalization with symbolize_names: trueJean Boussier
2021-02-07feat: allow scalars and sequences to be styled when dumpedJeremy Ebler
2020-12-23Skip test_ractor.rb with ruby/psych repoHiroshi SHIBATA
Because ruby/psych still uses minitest. minitest didn't support assert_ractor provided by test suite of ruby/ruby repo.
2020-12-23[ruby/psych] Optimize cache with `compare_by_identity`Marc-Andre Lafortune
Using `compare_by_identity` gives a 4x performance boost on cache hits. Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
2020-12-23[ruby/psych] Make Ractor-ready.Marc-Andre Lafortune
Config is Ractor-local. Benchmarking reveals that using `Ractor.local_storage` for storing cache is similar to accessing a constant (~15% slower).
2020-11-12Add `Psych.safe_load_file`. Tweak doc to provide `safe_` examples.Marc-Andre Lafortune
2020-09-10Forward keyword arguments in load_file and load_streamJean Boussier
2020-07-16Remove private_iv_getCharles Oliver Nutter
The only remaining use of this function was to get the internal message object from an exception's hidden `mesg` instance variable to allow it to be dumped wiithout converting to a string. As discussed in #103, this exposes internal implementation details of CRuby, and ultimately does not provide any real utility to the user since they can't directly inspect this hidden variable. The test change here is to reflect CRuby behavior that denies equality if the internal message objects do not match, as is the case after the exception has been loaded and now has a simple String value. The impact to users is that exceptions with special hidden message objects will convert those objects to String during marshaling through YAML. I believe this only affects NameError and its descendants, since users can't set this field directly on their own exception types. Fixes #103.
2020-06-23Fix remove warning & support multi-run test for ↵S-H-GAMELINKS
test/psych/visitors/test_to_ruby.rb
2020-06-23remove warning & support multi-run test for test/psych_test_yaml.rb (#2887)S.H
2020-06-23remove warning & support multi-run test for ↵S.H
test/psych/visitors/test_to_ruby.rb (#2881)
2020-06-08Fix anchor lookup with symbolized namesJean Boussier
2020-06-03Merge pull request #438 from mthorn/masterAaron Patterson
Fix ArgumentError with leading and trailing underscores in number str…
2020-06-03Fixing compatibility with libyaml 0.2.5Aaron Patterson
The main issue is that commas aren't allowed in local tags. libyaml was updated to follow the spec, and our tests were out of date. See: https://github.com/yaml/libyaml/issues/196
2020-03-03Fix ArgumentError with leading and trailing underscores in number strings.Mark Thorn
2019-11-28Implement `freeze` option for Pysch.loadJean Boussier
2019-10-21Remove taint supportJeremy Evans
Ruby 2.7 deprecates taint and it no longer has an effect. The lack of taint support should not cause a problem in previous Ruby versions. I'm not sure if the untaint calls in deduplicate are still needed after the removal of tainting in the parser. If they are not needed, they should be removed.
2019-07-25Suppress uninitialized instance variable warningsNobuyoshi Nakada
In verbose mode, `test_delegator` in `test/psych/visitors/test_yaml_tree.rb` shows following warning. https://travis-ci.org/ruby/psych/jobs/562435717#L268 ``` /home/travis/build/ruby/psych/test/psych/visitors/test_yaml_tree.rb:10: warning: instance variable @obj not initialized ``` This is because `Psych.load` bypasses #initialize with the #init_with method.
2019-07-22Deduplicate hash keys if they're stringsJean Boussier
2019-04-26Do not allocate a string to check if a scalar is an integerJean Boussier
2019-01-16Add test to demonstrate issue deserializing hash with ivarJordan Owens
Currently the elements of a hash are revived before any ivar values. This causes an issue when the `[]=` method references an instance variable.
2019-01-09Round trip exception backtracesAaron Patterson
This commit allows exception backtraces to round trip
2018-11-10Use friendlier terminology in YAML.safe_loadJuanito Fatas
Replace keyword argumment whitelist_classes and whitelist_symbols. with permitted_classes and permitted_symbols.
2018-10-20Avoid to warnings for deprecated interfaces.SHIBATA Hiroshi
2018-09-18Put parentheses before minus operator.SHIBATA Hiroshi
2018-09-18Prefer to use assert_nilSHIBATA Hiroshi
2018-07-13unifying interface of PsychGreg Houle
2018-07-12Added tests for special cases and better overall API test coverageGreg Houle
2018-04-24Add test cases for fallback argument of Psych.loadMarcus Stollsteimer
2018-04-24Add more test cases for fallback of Psych.load_fileMarcus Stollsteimer
Add test cases for the fallback keyword argument of Psych.load_file to make sure that a falsy fallback (nil or false) works properly.