summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test/psych/test_scalar_scanner.rb: Prevent a warningYusuke Endoh2021-09-281-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
* Bump up the latest version of CoreAssertionsHiroshi SHIBATA2021-09-111-30/+34
|
* Replace A-Za-z with [:alpha:]jory-graham2021-08-051-0/+22
|
* Merge pull request #515 from ruby/quote-y-nAaron Patterson2021-08-041-0/+13
|\ | | | | Add quotes to the strings "y" and "n"
| * Add quotes to the strings "y" and "n"Aaron Patterson2021-08-041-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
* | Merge pull request #460 from tbrisker/floatscannerAaron Patterson2021-08-041-0/+12
|\ \ | | | | | | Improve float scalar scanner
| * | Improve float scalar scannerTomer Brisker2020-08-081-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.
* | | Merge pull request #473 from OpakAlex/fix-integer-parsing-for-yamlAaron Patterson2021-08-041-2/+13
|\ \ \ | |_|/ |/| | fix parsing integer values with '_' at the end
| * | add more testsAlexandr Opak2021-01-291-2/+6
| | |
| * | fix typoAlexandr Opak2021-01-291-2/+2
| | |
| * | fix parsing integer values with '_' at the endAlexandr Opak2021-01-291-1/+8
| | |
* | | Merge pull request #507 from ahorek/delegate_fixHiroshi SHIBATA2021-06-161-0/+1
|\ \ \ | | | | | | | | require 'delegate' explicitly
| * | | require 'delegate' explicitlyPavel Rosický2021-06-071-0/+1
| | | |
* | | | Fix the test that does not work with libyaml-0.1.7Yusuke Endoh2021-06-071-1/+1
|/ / /
* | | 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
| | |
* | | test/psych/test_coder.rb: Suppress non-parenthesis warningsYusuke Endoh2021-06-071-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 ```
* | | Suppress debug messageNobuyoshi Nakada2021-06-071-0/+1
| | |
* | | Implement YAML.safe_dump to make safe_load more usable.Jean Boussier2021-05-191-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.
* | | 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
| | |
* | | remove deprecated interfaceAaron Patterson2021-05-133-68/+2
| | |
* | | Introduce `Psych.unsafe_load`Aaron Patterson2021-05-1324-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.
* | | Merge pull request #475 from whitehat101/feature/dynamic-scalar-seq-styleAaron Patterson2021-05-101-0/+121
|\ \ \ | | | | | | | | feat: allow scalars and sequences to be styled when dumped
| * | | feat: allow scalars and sequences to be styled when dumpedJeremy Ebler2021-02-071-0/+121
| |/ /
* | | Merge pull request #480 from Shopify/symbolize-name-non-string-keysHiroshi SHIBATA2021-05-101-3/+4
|\ \ \ | | | | | | | | Fix symbolize_name with non-string keys
| * | | Fix symabolize_name with non-string keysJean Boussier2021-02-251-3/+4
| | | |
* | | | Use assert_raise instead of assert_raisesHiroshi SHIBATA2021-05-1012-61/+61
| | | |
* | | | Removed needless platform detectionHiroshi SHIBATA2021-05-101-10/+0
| | | |
* | | | Import test assertions from ruby/rubyHiroshi SHIBATA2021-05-104-0/+1167
| | | |
* | | | Use pend instead of skipHiroshi SHIBATA2021-05-102-2/+2
| | | |
* | | | Fixed test-case for NaNHiroshi SHIBATA2021-05-101-2/+2
| | | |
* | | | Use Ractor constant for ignoreing conditionHiroshi SHIBATA2021-05-101-1/+1
| | | |
* | | | Use test-unit instead of minitestHiroshi SHIBATA2021-05-101-8/+2
|/ / /
* | | Fix custom marshalization with symbolize_names: trueJean Boussier2021-02-151-0/+8
|/ /
* | 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.
* | [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).
* | Add `Psych.safe_load_file`. Tweak doc to provide `safe_` examples.Marc-Andre Lafortune2020-11-122-0/+24
| |
* | Forward keyword arguments in load_file and load_streamJean Boussier2020-09-101-0/+34
|/
* Remove private_iv_getCharles Oliver Nutter2020-07-161-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.
* Fix remove warning & support multi-run test for ↵S-H-GAMELINKS2020-06-231-1/+1
| | | | test/psych/visitors/test_to_ruby.rb
* remove warning & support multi-run test for test/psych_test_yaml.rb (#2887)S.H2020-06-231-0/+1
|
* remove warning & support multi-run test for ↵S.H2020-06-231-0/+1
| | | | test/psych/visitors/test_to_ruby.rb (#2881)
* Fix anchor lookup with symbolized namesJean Boussier2020-06-081-0/+10
|
* Merge pull request #438 from mthorn/masterAaron Patterson2020-06-031-0/+3
|\ | | | | Fix ArgumentError with leading and trailing underscores in number str…
| * Fix ArgumentError with leading and trailing underscores in number strings.Mark Thorn2020-03-031-0/+3
| |
* | Fixing compatibility with libyaml 0.2.5Aaron Patterson2020-06-033-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
* Implement `freeze` option for Pysch.loadJean Boussier2019-11-281-0/+16
|
* Remove taint supportJeremy Evans2019-10-211-131/+0
| | | | | | | | | | 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.