summaryrefslogtreecommitdiff
path: root/spec/ruby/library
AgeCommit message (Collapse)Author
2025-10-07Fix tests to verify basic authenticationHiroshi SHIBATA
2023-06-24merge revision(s) ↵nagachika
cd5e6cc0ea48353c88d921b885b552dc76da255c,bbf54ec334fe2edd7669a944d88d17efde49a412: [Backport #19307] Update to ruby/mspec@fef9b81 --- spec/mspec/tool/tag_from_output.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Update to ruby/spec@9d69b95 --- spec/ruby/core/array/keep_if_spec.rb | 1 + spec/ruby/core/array/pack/c_spec.rb | 14 +- spec/ruby/core/array/pack/shared/basic.rb | 40 ++++ spec/ruby/core/array/pack/shared/float.rb | 66 ++++++- spec/ruby/core/array/pack/shared/integer.rb | 96 +++++++-- spec/ruby/core/array/pack/shared/numeric_basic.rb | 10 +- spec/ruby/core/array/pack/shared/unicode.rb | 14 +- spec/ruby/core/array/pack/w_spec.rb | 14 +- spec/ruby/core/array/shared/unshift.rb | 18 ++ spec/ruby/core/array/values_at_spec.rb | 1 + spec/ruby/core/array/zip_spec.rb | 6 + spec/ruby/core/class/subclasses_spec.rb | 22 +++ spec/ruby/core/dir/home_spec.rb | 44 +++-- spec/ruby/core/dir/mkdir_spec.rb | 18 +- spec/ruby/core/enumerable/zip_spec.rb | 5 + spec/ruby/core/float/comparison_spec.rb | 35 ++-- spec/ruby/core/float/divmod_spec.rb | 2 +- spec/ruby/core/float/gt_spec.rb | 21 ++ spec/ruby/core/float/gte_spec.rb | 21 ++ spec/ruby/core/float/lt_spec.rb | 21 ++ spec/ruby/core/float/lte_spec.rb | 21 ++ spec/ruby/core/float/shared/equal.rb | 21 ++ spec/ruby/core/io/gets_spec.rb | 4 + spec/ruby/core/io/lineno_spec.rb | 9 +- spec/ruby/core/io/new_spec.rb | 2 + spec/ruby/core/io/readline_spec.rb | 4 + spec/ruby/core/io/readlines_spec.rb | 4 + spec/ruby/core/io/shared/each.rb | 4 + spec/ruby/core/io/shared/new.rb | 2 + spec/ruby/core/io/shared/pos.rb | 8 +- spec/ruby/core/io/shared/readlines.rb | 4 + spec/ruby/core/io/sysseek_spec.rb | 2 +- spec/ruby/core/kernel/shared/load.rb | 31 ++- spec/ruby/core/kernel/singleton_class_spec.rb | 2 + spec/ruby/core/marshal/dump_spec.rb | 45 ++++- spec/ruby/core/marshal/fixtures/classes.rb | 4 + spec/ruby/core/matchdata/values_at_spec.rb | 73 ++++++- spec/ruby/core/module/fixtures/classes.rb | 1 + spec/ruby/core/module/include_spec.rb | 4 +- spec/ruby/core/module/prepend_spec.rb | 12 ++ .../ruby/core/objectspace/define_finalizer_spec.rb | 22 +++ spec/ruby/core/process/constants_spec.rb | 1 + spec/ruby/core/process/detach_spec.rb | 29 +++ spec/ruby/core/process/spawn_spec.rb | 10 + spec/ruby/core/process/times_spec.rb | 2 +- spec/ruby/core/queue/initialize_spec.rb | 13 +- spec/ruby/core/refinement/import_methods_spec.rb | 34 ++++ spec/ruby/core/refinement/include_spec.rb | 27 +++ spec/ruby/core/refinement/prepend_spec.rb | 27 +++ spec/ruby/core/regexp/initialize_spec.rb | 2 +- spec/ruby/core/signal/trap_spec.rb | 12 ++ spec/ruby/core/string/byteslice_spec.rb | 6 + spec/ruby/core/string/capitalize_spec.rb | 4 + spec/ruby/core/string/chars_spec.rb | 7 +- spec/ruby/core/string/chomp_spec.rb | 4 + spec/ruby/core/string/chop_spec.rb | 4 + spec/ruby/core/string/clone_spec.rb | 4 + spec/ruby/core/string/delete_prefix_spec.rb | 4 + spec/ruby/core/string/delete_spec.rb | 4 + spec/ruby/core/string/delete_suffix_spec.rb | 4 + spec/ruby/core/string/downcase_spec.rb | 4 + spec/ruby/core/string/dump_spec.rb | 10 +- spec/ruby/core/string/dup_spec.rb | 4 + spec/ruby/core/string/lines_spec.rb | 1 - spec/ruby/core/string/reverse_spec.rb | 4 + spec/ruby/core/string/scan_spec.rb | 6 + spec/ruby/core/string/scrub_spec.rb | 10 + spec/ruby/core/string/shared/each_line.rb | 6 + spec/ruby/core/string/shared/partition.rb | 15 ++ spec/ruby/core/string/shared/slice.rb | 13 +- spec/ruby/core/string/shared/strip.rb | 4 + spec/ruby/core/string/shared/succ.rb | 4 + spec/ruby/core/string/split_spec.rb | 17 +- spec/ruby/core/string/squeeze_spec.rb | 5 + spec/ruby/core/string/swapcase_spec.rb | 4 + spec/ruby/core/string/undump_spec.rb | 2 +- spec/ruby/core/string/unpack/b_spec.rb | 28 ++- spec/ruby/core/string/unpack/c_spec.rb | 14 +- spec/ruby/core/string/unpack/h_spec.rb | 28 ++- spec/ruby/core/string/unpack/shared/basic.rb | 28 --- spec/ruby/core/string/unpack/shared/float.rb | 60 +++++- spec/ruby/core/string/unpack/shared/integer.rb | 88 +++++++-- spec/ruby/core/string/unpack/shared/unicode.rb | 14 +- spec/ruby/core/string/unpack/w_spec.rb | 14 +- spec/ruby/core/string/unpack1_spec.rb | 12 +- spec/ruby/core/string/unpack_spec.rb | 34 ++++ spec/ruby/core/string/upcase_spec.rb | 4 + spec/ruby/core/string/valid_encoding/utf_8_spec.rb | 214 +++++++++++++++++++++ spec/ruby/core/struct/values_at_spec.rb | 55 +++++- spec/ruby/core/symbol/shared/id2name.rb | 7 + spec/ruby/core/time/at_spec.rb | 16 ++ spec/ruby/core/time/localtime_spec.rb | 16 +- spec/ruby/core/time/new_spec.rb | 94 +++++++-- spec/ruby/core/time/shared/gmtime.rb | 4 +- spec/ruby/core/time/shared/time_params.rb | 11 +- spec/ruby/core/time/strftime_spec.rb | 40 +++- spec/ruby/core/time/utc_spec.rb | 41 +++- spec/ruby/core/time/zone_spec.rb | 20 +- spec/ruby/core/tracepoint/inspect_spec.rb | 9 + spec/ruby/fixtures/code/load_wrap_fixture.rb | 12 ++ spec/ruby/fixtures/code/wrap_fixture.rb | 9 - spec/ruby/language/case_spec.rb | 4 +- .../ruby/language/regexp/character_classes_spec.rb | 5 + spec/ruby/library/coverage/running_spec.rb | 20 ++ spec/ruby/library/date/civil_spec.rb | 7 +- spec/ruby/library/objectspace/fixtures/trace.rb | 5 + spec/ruby/library/objectspace/trace_spec.rb | 15 ++ spec/ruby/library/openssl/x509/name/verify_spec.rb | 4 +- spec/ruby/library/stringio/initialize_spec.rb | 85 ++++++++ spec/ruby/library/stringio/new_spec.rb | 8 + spec/ruby/library/stringio/shared/write.rb | 22 +++ spec/ruby/optional/capi/ext/io_spec.c | 43 +++++ spec/ruby/optional/capi/io_spec.rb | 15 ++ spec/ruby/shared/rational/Rational.rb | 48 ++--- 114 files changed, 1963 insertions(+), 245 deletions(-) create mode 100644 spec/ruby/core/marshal/fixtures/classes.rb create mode 100644 spec/ruby/core/refinement/import_methods_spec.rb create mode 100644 spec/ruby/core/refinement/include_spec.rb create mode 100644 spec/ruby/core/refinement/prepend_spec.rb create mode 100644 spec/ruby/core/string/unpack_spec.rb create mode 100644 spec/ruby/core/string/valid_encoding/utf_8_spec.rb create mode 100644 spec/ruby/fixtures/code/load_wrap_fixture.rb delete mode 100644 spec/ruby/fixtures/code/wrap_fixture.rb create mode 100644 spec/ruby/library/coverage/running_spec.rb create mode 100644 spec/ruby/library/objectspace/fixtures/trace.rb create mode 100644 spec/ruby/library/objectspace/trace_spec.rb create mode 100644 spec/ruby/library/stringio/new_spec.rb
2023-01-25merge revision(s) ↵NARUSE, Yui
2c93c554019ebdc394d3c51c6d925620d3005f84,f5ea43a2e61789357e9c4b374b4bc6756abeae17: [Backport #19360] Ensure main file has default coverage if required. (#7169) * Extract common code for coverage setup. --- iseq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) More coverage tests & specs. (#7171) * Add spec for eval and line coverage. * Add test for main file coverage. --- spec/ruby/library/coverage/start_spec.rb | 8 +++++++- test/coverage/autostart.rb | 2 ++ test/coverage/main.rb | 1 + test/coverage/test_coverage.rb | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/coverage/autostart.rb create mode 100644 test/coverage/main.rb
2022-12-15Remove `require 'io/wait'` where it's no longer necessary. (#6932)Samuel Williams
* Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-12-06update rbconfig spec to Unicode version 15.0.0Martin Dürst
(this includes emoji version 15.0)
2022-11-22Use valid tokens as cookie namesNobuyoshi Nakada
2022-11-12Deal with different Ruby versionsTakashi Kokubun
2022-11-12Fix a CI failure in bigdecimalTakashi Kokubun
2022-11-07Update to ruby/spec@740ccc8Benoit Daloze
2022-10-08Add spec for `Coverage.supported?` and `start(eval: true)`. (#6499)Samuel Williams
* Don't emit coverage for eval when eval coverage is disabled. Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-10-07Add IO#timeout attribute and use it for blocking IO operations. (#5653)Samuel Williams
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
2022-09-29Skip unpack_sockaddr_in with http at Solaris platformHiroshi SHIBATA
http://rubyci.s3.amazonaws.com/solaris10-gcc/ruby-master/log/20220929T050003Z.fail.html.gz
2022-09-28Update to ruby/spec@1d9d5c6Benoit Daloze
2022-09-26Revert this until we can figure out WB issues or remove shapes from GCAaron Patterson
Revert "* expand tabs. [ci skip]" This reverts commit 830b5b5c351c5c6efa5ad461ae4ec5085e5f0275. Revert "This commit implements the Object Shapes technique in CRuby." This reverts commit 9ddfd2ca004d1952be79cf1b84c52c79a55978f4.
2022-09-26This commit implements the Object Shapes technique in CRuby.Jemma Issroff
Object Shapes is used for accessing instance variables and representing the "frozenness" of objects. Object instances have a "shape" and the shape represents some attributes of the object (currently which instance variables are set and the "frozenness"). Shapes form a tree data structure, and when a new instance variable is set on an object, that object "transitions" to a new shape in the shape tree. Each shape has an ID that is used for caching. The shape structure is independent of class, so objects of different types can have the same shape. For example: ```ruby class Foo def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end class Bar def initialize # Starts with shape id 0 @a = 1 # transitions to shape id 1 @b = 1 # transitions to shape id 2 end end foo = Foo.new # `foo` has shape id 2 bar = Bar.new # `bar` has shape id 2 ``` Both `foo` and `bar` instances have the same shape because they both set instance variables of the same name in the same order. This technique can help to improve inline cache hits as well as generate more efficient machine code in JIT compilers. This commit also adds some methods for debugging shapes on objects. See `RubyVM::Shape` for more details. For more context on Object Shapes, see [Feature: #18776] Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org> Co-Authored-By: Eileen M. Uchitelle <eileencodes@gmail.com> Co-Authored-By: John Hawthorn <john@hawthorn.email> Notes: Merged: https://github.com/ruby/ruby/pull/6386
2022-09-22Enable coverage for eval.Samuel Williams
Notes: Merged: https://github.com/ruby/ruby/pull/6396
2022-08-29Update to ruby/spec@b8a8240Benoit Daloze
2022-08-29Update to ruby/spec@d01709fBenoit Daloze
2022-08-08[Bug #18946] New tests for fixed Time/DateTime conversionsNobuyoshi Nakada
2022-08-08[Bug #18946] Use Gregorian dates to testNobuyoshi Nakada
2022-07-27Update to ruby/spec@cbfaf51Benoit Daloze
2022-07-02Relax `not_before` limitNobuyoshi Nakada
Use the value as similar as other tests below. Trying to fix sporadic “not yet valid” failures on some CIs. Notes: Merged: https://github.com/ruby/ruby/pull/6085
2022-07-01Fix TODO in stringio/truncate_spec.rbNobuyoshi Nakada
2022-07-01stop CI failures.Koichi Sasada
302f353fd9223d020e48495eaa7a03ce5d539409 seems break the rubyspec. @nobu please check it.
2022-06-30Add more check to debug failuresKazuhiro NISHIYAMA
2022-06-26Update to ruby/spec@ab32a1aBenoit Daloze
2022-05-29Update rubyspec for stringio bug fixJeremy Evans
2022-04-25Update to ruby/spec@3affe1eBenoit Daloze
2022-03-28Update to ruby/spec@aaf998fBenoit Daloze
2022-03-14clarify meaning of version guards for Unicode version specs [ci skip]Martin Dürst
2022-03-13Fix guards for unicode versions specsBenoit Daloze
2022-03-13comment out failing Unicode/Emoji version checks temporarilyMartin Dürst
2022-03-13update specs to check for Unicode Version 14.0.0/Emoji Version 14.0Martin Dürst
2022-02-26Deprecate the unintentional ability to parse `Symbol`Nobuyoshi Nakada
2022-01-28Update to ruby/spec@902ab83Benoit Daloze
2022-01-10Update to ruby/spec@226cfdcBenoit Daloze
2021-12-08Skip bind port 1 when ip_unprivileged_port_start<=1Kazuhiro NISHIYAMA
Linux can allow to bind port 1 to user. And `ip_unprivileged_port_start` is 0 on [lima](https://github.com/lima-vm/lima) default vm. ``` 1) Socket#bind on SOCK_DGRAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED Expected Errno::EACCES but no exception was raised (0 was returned) .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:38:in `block (4 levels) in <top (required)>' .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:4:in `<top (required)>' 2) Socket#bind on SOCK_STREAM socket raises Errno::EACCES when the current user does not have permission to bind FAILED Expected Errno::EACCES but no exception was raised (0 was returned) .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:79:in `block (4 levels) in <top (required)>' .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:44:in `<top (required)>' 3) Socket#bind using IPv4 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED Expected Errno::EACCES but no exception was raised (0 was returned) .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>' .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>' 4) Socket#bind using IPv6 using a packed socket address raises Errno::EACCES when the user is not allowed to bind to the port FAILED Expected Errno::EACCES but no exception was raised (0 was returned) .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:119:in `block (6 levels) in <top (required)>' .../ruby/spec/ruby/library/socket/socket/bind_spec.rb:85:in `<top (required)>' ```
2021-11-29Update to ruby/spec@7f22a0bBenoit Daloze
2021-11-16Revert "Temporary ignored the failing specs for Date"Yusuke Endoh
This reverts commit 17e64cca6b737060884f6fd9ab1c5055e9b49577. The specs should work now.
2021-11-16Temporary ignored the failing specs for DateHiroshi SHIBATA
2021-10-25Make Coverage suspendable (#4856)Yusuke Endoh
* Make Coverage suspendable Add `Coverage.suspend`, `Coverage.resume` and some methods. [Feature #18176] [ruby-core:105321] Notes: Merged-By: mame <mame@ruby-lang.org>
2021-10-20Update to ruby/spec@254c380Benoit Daloze
2021-10-20Update to ruby/spec@d6921efBenoit Daloze
2021-10-13Fix a typoKazuhiro NISHIYAMA
2021-10-10Use an isolated classNobuyoshi Nakada
The number of all instances of `Class` may be affected by GC-able anonymous classes created by other tests.
2021-10-07Followed up bd6e1a0f0883dba7b02f30cefe5ebec96d02cb90Hiroshi SHIBATA
2021-10-05Update to ruby/spec@ccf0d85Benoit Daloze
2021-09-28Followed up behavior change of setHiroshi SHIBATA
https://github.com/ruby/ruby/commit/f360ebb30606a4143029996073d29d007069428d
2021-09-28Followed up ruby/spec examples for date.Hiroshi SHIBATA
https://github.com/ruby/ruby/commit/f9f7f3a75ec5af4a70e3332f8f5aa300c13432e2
2021-09-07Update to ruby/spec@b1e93a2Benoit Daloze