path: root/test/psych
AgeCommit message (Collapse)Author
2022-09-07[ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as TimeNobuyoshi Nakada
Fix ruby/psych#572
2022-08-09[ruby/psych] Raise specific error when an anchor isn't definedAlexander Momchilov
2022-08-09[ruby/psych] Update to squiggly heredocs in the fileAlexander Momchilov
2022-08-09[ruby/psych] Add test for missing anchorAlexander Momchilov
2022-08-09[ruby/psych] Add test for anchor reuseAlexander Momchilov
The spec calls this a "reuse" of an anchor
2022-08-09[ruby/psych] Raise specific error when aliases are not enabledAlexander Momchilov
2022-08-09[ruby/psych] Don't hardcode expected alias namesAlexander Momchilov
2022-08-09[ruby/psych] Test that recursive refs dump as aliasesAlexander Momchilov
2022-08-09[ruby/psych] Clarify tests about parsing aliasesAlexander Momchilov
2022-01-22[ruby/psych] Add strict_integer option to parse numbers with commas as stringsSeth Boyles
Authored-by: Seth Boyles <>
2021-09-09test/psych/test_scalar_scanner.rb: Prevent a warningYusuke Endoh
``` [ 4696/20990] TestAst#test_ranges:test/psych/test_scalar_scanner.rb(none):138: warning: ambiguous first argument; put parentheses or a space even after `-' operator ```
2021-08-31[ruby/psych] Replace A-Za-z with [:alpha:]jory-graham
2021-08-31[ruby/psych] Add quotes to the strings "y" and "n"Aaron Patterson
'y' and 'n' are kind of ambiguous. Syck treated y and n literals in YAML documents as strings. But this is not what the YAML 1.1 spec says. YAML 1.1 says they should be treated as booleans. When we're dumping documents, we know it's a string, so adding quotes will eliminate the "ambiguity" in the emitted document Fixes #443
2021-08-31[ruby/psych] add more testsAlexandr Opak
2021-08-31[ruby/psych] fix typoAlexandr Opak
2021-08-31[ruby/psych] fix parsing integer values with '_' at the endAlexandr Opak
2021-08-31[ruby/psych] Improve float scalar scannerTomer Brisker
Previously, `+.inf` was not handled correctly. Additionally, the regexp was checking for inf and NaN, even though these cases are handled earlier in the condition. Added a few tests to ensure handling some missing cases.
2021-07-29[ruby/psych] require 'delegate' explicitlyPavel Rosický
2021-06-08[ruby/psych] Fix 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-07[ruby/psych] Implement 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-26Suppress debug messageNobuyoshi Nakada
2021-05-18test/psych/test_coder.rb: Suppress non-parenthesis warningsYusuke Endoh ``` /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-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-17[ruby/psych] remove deprecated interfaceAaron Patterson
2021-05-17[ruby/psych] Introduce `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-17[ruby/psych] Fix symabolize_name with non-string keysJean Boussier
2021-05-17[ruby/psych] feat: allow scalars and sequences to be styled when dumpedJeremy Ebler
2021-05-10[ruby/psych] Fix custom marshalization with symbolize_names: trueJean Boussier
2021-05-10[ruby/psych] Use assert_raise instead of assert_raisesHiroshi SHIBATA
2021-05-10[ruby/psych] Use pend instead of skipHiroshi SHIBATA
2021-05-10[ruby/psych] Fixed test-case for NaNHiroshi SHIBATA
2021-05-10[ruby/psych] Use Ractor constant for ignoreing conditionHiroshi SHIBATA
2021-05-10[ruby/psych] Use test-unit instead of minitestHiroshi SHIBATA
2020-12-23[ruby/psych] Skip 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 Notes: Merged:
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). Notes: Merged:
2020-12-14Merge Psych-3.2.1 from ruby/psychHiroshi SHIBATA
2020-09-25[ruby/psych] Forward keyword arguments in load_file and load_streamJean Boussier
2020-09-25Remove 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-23[ruby/psych] Fix anchor lookup with symbolized namesJean Boussier
2020-06-05[ruby/psych] Fixing 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: Notes: Merged:
2020-06-05[ruby/psych] Fix ArgumentError with leading and trailing underscores in ↵Mark Thorn
number strings. Notes: Merged:
2020-06-05[ruby/psych] Implement `freeze` option for Pysch.loadJean Boussier Notes: Merged:
2020-02-13Fix remove warning & support multi-run test for ↵S-H-GAMELINKS
test/psych/visitors/test_to_ruby.rb Notes: Merged:
2020-02-07remove warning & support multi-run test for test/psych_test_yaml.rb (#2887)S.H
Notes: Merged-By: nurse <>
2020-02-07remove warning & support multi-run test for ↵S.H
test/psych/visitors/test_to_ruby.rb (#2881) Notes: Merged-By: nurse <>
2019-11-12[ruby/psych] Remove 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.