summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Update test libraries from ↵Hiroshi SHIBATA2023-03-242-68/+109
| | | | https://github.com/ruby/ruby/commit/b4e438d8aabaf4bba2b27f374c787543fae07c58
* Fix RestrictedYAMLTree allowing the Symbol class should allow all symbolsJean Boussier2023-01-221-2/+5
| | | | | | | | | | | | 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.
* Update for stricter 1.2 syntaxCharles Oliver Nutter2023-01-181-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.
* Get rid of anonymous eval callsJean Boussier2023-01-112-4/+4
| | | | Things declared in anonymous eval are always annoying to locate.
* Always issue deprecation warning when calling Regexp.new with 3rd positional ↵Jeremy Evans2022-12-231-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>
* Only ignore current failures in JRubyDavid Rodríguez2022-10-073-0/+21
| | | | | This way we should be able to prevent new regressions from being introduced.
* Dump Date/DateTime as proleptic Gregorian date as well as TimeNobuyoshi Nakada2022-08-091-0/+20
| | | | Fix ruby/psych#572
* Raise specific error when an anchor isn't definedAlexander Momchilov2022-07-272-2/+2
|
* Update to squiggly heredocs in the fileAlexander Momchilov2022-07-271-12/+12
|
* Add test for missing anchorAlexander Momchilov2022-07-271-0/+11
|
* Add test for anchor reuseAlexander Momchilov2022-07-271-0/+11
| | | | | The spec calls this a "reuse" of an anchor https://yaml.org/spec/1.2.2/#71-alias-nodes
* Raise specific error when aliases are not enabledAlexander Momchilov2022-07-276-8/+8
|
* Don't hardcode expected alias namesAlexander Momchilov2022-07-273-22/+28
|
* Test that recursive refs dump as aliasesAlexander Momchilov2022-07-223-0/+37
|
* Clarify tests about parsing aliasesAlexander Momchilov2022-07-221-8/+21
|
* Add strict_integer option to parse numbers with commas as stringsSeth Boyles2022-01-142-0/+36
| | | | Authored-by: Seth Boyles <sethboyles@gmail.com>
* s/RubyVM::JIT/RubyVM::MJIT/gTakashi Kokubun2021-12-141-1/+1
|
* 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
| | | |