summaryrefslogtreecommitdiff
path: root/test/psych
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/psych] Update for stricter 1.2 syntaxCharles Oliver Nutter2023-01-311-16/+16
| | | | | | | This allows these tests to pass on SnakeYAML Engine -- which is a 1.2-only YAML library -- while still passing on libyaml 1.1. https://github.com/ruby/psych/commit/f44269fc9b
* [ruby/psych] Fix RestrictedYAMLTree allowing the Symbol class should allow ↵Jean Boussier2023-01-231-2/+5
| | | | | | | | | | | | | | | | all symbols Ref: https://github.com/ruby/psych/pull/495 That's how it works for `safe_load`: ```ruby >> YAML.safe_load(':foo', permitted_classes: [Symbol]) => :foo ``` So `safe_dump` should mirror that. https://github.com/ruby/psych/commit/592a75a656
* [ruby/psych] Get rid of anonymous eval callsJean Boussier2023-01-112-4/+4
| | | | | | Things declared in anonymous eval are always annoying to locate. https://github.com/ruby/psych/commit/38871ad4e5
* Always issue deprecation warning when calling Regexp.new with 3rd positional ↵Jeremy Evans2022-12-221-1/+1
| | | | | | | | | | | | | | argument Previously, only certain values of the 3rd argument triggered a deprecation warning. First step for fix for bug #18797. Support for the 3rd argument will be removed after the release of Ruby 3.2. Fix minor fallout discovered by the tests. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* Merge Psych-5.0.1Hiroshi SHIBATA2022-12-093-0/+21
|
* [ruby/psych] Dump Date/DateTime as proleptic Gregorian date as well as TimeNobuyoshi Nakada2022-09-071-0/+20
| | | | | | Fix ruby/psych#572 https://github.com/ruby/psych/commit/92304269bc
* [ruby/psych] Raise specific error when an anchor isn't definedAlexander Momchilov2022-08-092-2/+2
| | | | https://github.com/ruby/psych/commit/98fbd5247a
* [ruby/psych] Update to squiggly heredocs in the fileAlexander Momchilov2022-08-091-12/+12
| | | | https://github.com/ruby/psych/commit/42b43de997
* [ruby/psych] Add test for missing anchorAlexander Momchilov2022-08-091-0/+11
| | | | https://github.com/ruby/psych/commit/5f08137ae6
* [ruby/psych] Add test for anchor reuseAlexander Momchilov2022-08-091-0/+11
| | | | | | | The spec calls this a "reuse" of an anchor https://yaml.org/spec/1.2.2/#71-alias-nodes https://github.com/ruby/psych/commit/57e3b70a56
* [ruby/psych] Raise specific error when aliases are not enabledAlexander Momchilov2022-08-096-8/+8
| | | | https://github.com/ruby/psych/commit/0c11ddcf46
* [ruby/psych] Don't hardcode expected alias namesAlexander Momchilov2022-08-093-22/+28
| | | | https://github.com/ruby/psych/commit/b9ab19094f
* [ruby/psych] Test that recursive refs dump as aliasesAlexander Momchilov2022-08-093-0/+37
| | | | https://github.com/ruby/psych/commit/d9f7289190
* [ruby/psych] Clarify tests about parsing aliasesAlexander Momchilov2022-08-091-8/+21
| | | | https://github.com/ruby/psych/commit/0bc30cb4cb
* [ruby/psych] Add strict_integer option to parse numbers with commas as stringsSeth Boyles2022-01-222-0/+36
| | | | | | Authored-by: Seth Boyles <sethboyles@gmail.com> https://github.com/ruby/psych/commit/75bebb37b8
* test/psych/test_scalar_scanner.rb: Prevent a warningYusuke Endoh2021-09-091-1/+1
| | | | | | | ``` [ 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 ``` http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20210909T123007Z.log.html.gz
* [ruby/psych] Replace A-Za-z with [:alpha:]jory-graham2021-08-311-0/+22
| | | | https://github.com/ruby/psych/commit/8ec36494fb
* [ruby/psych] Add quotes to the strings "y" and "n"Aaron Patterson2021-08-311-0/+13
| | | | | | | | | | | | '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 https://github.com/ruby/psych/commit/6a1c30634e
* [ruby/psych] add more testsAlexandr Opak2021-08-311-2/+6
| | | | https://github.com/ruby/psych/commit/8f71222bf3
* [ruby/psych] fix typoAlexandr Opak2021-08-311-2/+2
| | | | https://github.com/ruby/psych/commit/ebb0cbded1
* [ruby/psych] fix parsing integer values with '_' at the endAlexandr Opak2021-08-311-1/+8
| | | | https://github.com/ruby/psych/commit/e0bb853014
* [ruby/psych] Improve float scalar scannerTomer Brisker2021-08-311-0/+12
| | | | | | | | | 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. https://github.com/ruby/psych/commit/6e0e7a1e9f
* [ruby/psych] require 'delegate' explicitlyPavel Rosický2021-07-291-0/+1
| | | | https://github.com/ruby/psych/commit/51a9ce13db
* [ruby/psych] Fix the test that does not work with libyaml-0.1.7Yusuke Endoh2021-06-081-1/+1
| | | | https://github.com/ruby/psych/commit/542cf9754f
* Do not use YAML module in tests of PsychHiroshi SHIBATA2021-06-071-8/+8
|
* Use assert_raise instead of assert_raisesHiroshi SHIBATA2021-06-071-4/+4
|
* [ruby/psych] Implement YAML.safe_dump to make safe_load more usable.Jean Boussier2021-06-071-0/+57
| | | | | | | | | | | 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. https://github.com/ruby/psych/commit/441958396f
* Suppress debug messageNobuyoshi Nakada2021-05-261-0/+1
|
* test/psych/test_coder.rb: Suppress non-parenthesis warningsYusuke Endoh2021-05-181-3/+3
| | | | | | | 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 ```
* Make the test pass with the old libyamlYusuke Endoh2021-05-171-3/+3
| | | | | I have no idea what result is right, but it fails with libyaml 0.1.7 (bundled with Ubuntu 18.04) anyway.
* assert_equal accepts an expected value as the first argumentYusuke Endoh2021-05-171-15/+15
|
* [ruby/psych] remove deprecated interfaceAaron Patterson2021-05-173-68/+2
| | | | https://github.com/ruby/psych/commit/0767227051
* [ruby/psych] Introduce `Psych.unsafe_load`Aaron Patterson2021-05-1724-118/+149
| | | | | | | | | | | | | | | | 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. https://github.com/ruby/psych/commit/cb50aa8d3f
* [ruby/psych] Fix symabolize_name with non-string keysJean Boussier2021-05-171-3/+4
| | | | https://github.com/ruby/psych/commit/1c5c29e81f
* [ruby/psych] feat: allow scalars and sequences to be styled when dumpedJeremy Ebler2021-05-171-0/+121
| | | | https://github.com/ruby/psych/commit/546154ddb7
* [ruby/psych] Fix custom marshalization with symbolize_names: trueJean Boussier2021-05-101-0/+8
| | | | https://github.com/ruby/psych/commit/ee26f26ab5
* [ruby/psych] Use assert_raise instead of assert_raisesHiroshi SHIBATA2021-05-1012-61/+61
| | | | https://github.com/ruby/psych/commit/e6ad12b4e1
* [ruby/psych] Use pend instead of skipHiroshi SHIBATA2021-05-102-2/+2
| | | | https://github.com/ruby/psych/commit/efd2a62c9a
* [ruby/psych] Fixed test-case for NaNHiroshi SHIBATA2021-05-101-2/+2
| | | | https://github.com/ruby/psych/commit/f85a008263
* [ruby/psych] Use Ractor constant for ignoreing conditionHiroshi SHIBATA2021-05-101-1/+1
| | | | https://github.com/ruby/psych/commit/cc5f957327
* [ruby/psych] Use test-unit instead of minitestHiroshi SHIBATA2021-05-101-8/+2
| | | | https://github.com/ruby/psych/commit/01e7310dd3
* [ruby/psych] Skip test_ractor.rb with ruby/psych repoHiroshi SHIBATA2020-12-231-1/+1
| | | | | | | Because ruby/psych still uses minitest. minitest didn't support assert_ractor provided by test suite of ruby/ruby repo. https://github.com/ruby/psych/commit/7da26358f1
* [ruby/psych] Optimize cache with `compare_by_identity`Marc-Andre Lafortune2020-12-231-0/+3
| | | | | Using `compare_by_identity` gives a 4x performance boost on cache hits. Benchmark in https://github.com/JuanitoFatas/fast-ruby/issues/189
* [ruby/psych] Make Ractor-ready.Marc-Andre Lafortune2020-12-231-0/+47
| | | | | | | Config is Ractor-local. Benchmarking reveals that using `Ractor.local_storage` for storing cache is similar to accessing a constant (~15% slower).
* Merge Psych-3.2.1 from ruby/psychHiroshi SHIBATA2020-12-142-0/+24
|
* [ruby/psych] Forward keyword arguments in load_file and load_streamJean Boussier2020-09-251-0/+34
| | | | https://github.com/ruby/psych/commit/4e1dd37f09
* Remove private_iv_getCharles Oliver Nutter2020-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* [ruby/psych] Fix anchor lookup with symbolized namesJean Boussier2020-06-231-0/+10
| | | | https://github.com/ruby/psych/commit/ef74fc01e2
* [ruby/psych] Fixing compatibility with libyaml 0.2.5Aaron Patterson2020-06-053-24/+21
| | | | | | | | | 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 https://github.com/ruby/psych/commit/3f5e520fd3
* [ruby/psych] Fix ArgumentError with leading and trailing underscores in ↵Mark Thorn2020-06-051-0/+3
| | | | | | number strings. https://github.com/ruby/psych/commit/ac2d2c9b1b