summaryrefslogtreecommitdiff
path: root/spec
AgeCommit message (Collapse)Author
2018-08-06enumerator.c: Introduce Enumerator::ArithmeticSequencemrkn
This commit introduces new core class Enumerator::ArithmeticSequence. Enumerator::ArithmeticSequence is a subclass of Enumerator, and represents a number generator of an arithmetic sequence. After this commit, Numeric#step and Range#step without blocks returned an ArithmeticSequence object instead of an Enumerator. This class introduces the following incompatibilities: - You can create a zero-step ArithmeticSequence, and its size is not ArgumentError, but Infinity. - You can create a negative-step ArithmeticSequence from a range. [ruby-core:82816] [Feature #13904] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03spec/ruby/library/socket/socket/getaddrinfo_spec.rb: avoid nonsensical lookupnormal
"http" is a TCP service, so /etc/services on typical GNU/Linux systems only specify a TCP port for it. Use "discard" since it seems used for other specs and is specified as both TCP and UDP. This caused many CI failures like the following: git clone https://gist.github.com/812a9b747e4c4cb2e844d4be7991cd2d git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03Update to ruby/spec@9be7c7eeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03Update to ruby/mspec@072849eeregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03encoding.c (rb_enc_get_index): return -1 for non-encoding capable objectseregon
* Clarify logic and add spec. * Now passes test-all with the JSON fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03Revert "encoding.c (rb_enc_get_index): return -1 for non-encoding capable ↵eregon
objects" * This reverts commit fb253d2032e51f333e6577aa4fcf0c03f9c6fc02. * The CI is failing, this seems a bug in the JSON C extension. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03encoding.c (rb_enc_get_index): return -1 for non-encoding capable objectseregon
* Clarify logic and add spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-08-03encoding.c (enc_set_index): raise instead of rb_bug() for non-encoding ↵eregon
capable objects * Add spec. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-11spec/ruby/security/cve_2018_6914_spec.rb: get rid of leftover filesnormal
I ran out of inodes in $TMPDIR :< git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07process.c (rb_f_exec): pause MJIT before replacing processnormal
Non-parallel "make test-spec" caused spec/ruby/core/process/wait2_spec.rb failures because mspec uses "exec" in single-process mode, so there's no chance the post-exec state could know about the MJIT child process from its pre-exec state. [ruby-core:87846] [Bug #14867] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-07wait2_spec.rb: skip leak checker for nowk0kubun
This is not working with cppflags="-DMJIT_FORCE_ENABLE" on my machine. ``` $ make test-spec $ /home/k0kubun/src/github.com/ruby/ruby-svn/.ruby-force/miniruby -I/home/k0kubun/src/github.com/ruby/ruby-svn/lib /home/k0kubun/src/github.com/ruby/ruby-svn/tool/runruby.rb --archdir=/home/k0kubun/src/github.com/ruby/ruby-svn/.ruby-force --extout=.ext -- /home/k0kubun/src/github.com/ruby/ruby-svn/spec/mspec/bin/mspec-run -B ../spec/default.mspec ruby 2.6.0dev (2018-07-07 trunk 63874) +JIT [x86_64-linux] [| | ================ 40% | 00:02:03] 0F 0E leaked before wait2 specs: [[31406, #<Process::Status: pid 31406 exit 0>]] 1) An exception occurred during: before :all FAILED Expected [[31406, #<Process::Status: pid 31406 exit 0>]] to be empty /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:18:in `block (3 levels) in <top (required)>' /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:16:in `block (2 levels) in <top (required)>' /home/k0kubun/src/github.com/ruby/ruby-svn/spec/ruby/core/process/wait2_spec.rb:3:in `<top (required)>' [- | ==================100%================== | 00:00:00] 1F 0E Finished in 103.288794 seconds 3607 files, 28545 examples, 208272 expectations, 1 failure, 0 errors, 0 tagged uncommon.mk:777: recipe for target 'yes-test-spec' failed make: *** [yes-test-spec] Error 1 ``` Let me skip this for now and enable MJIT CI again. Related to Bug#14867 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-06const_missing on private constantsnobu
* variable.c (rb_const_search): call #const_missing method on private constants, as well as uninitialized constants. [Feature #14328] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-05unrevert r63852 but keep SIGCHLD path disabled for win32normal
Reading win32/win32.c waitpid implementation, maybe waitpid(-1, ...) on that platform will never conflict with mjit use of waitpid. In any case, I've added WAITPID_USE_SIGCHLD macro to vm_core.h so it can be easy for Linux/BSD users to test (hopefully!) win32-compatible code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-04Revert r63758 and related commitsnaruse
The change is unstable on Windows. Please re-commit it when it correctly supports Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63852 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-03rubyopt_spec.rb: skip -v in RUBYOPT examplesnobu
* spec/ruby/command_line/rubyopt_spec.rb: skip -v in RUBYOPT examples when CROSS_COMPILING is set by fake.rb. the version number by -v is printed before loading libraries by -r options, so setting RUBY_DESCRIPTION in fake.rb has no effect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-02time.c: [DOC] Time#localtimenobu
* time.c: state that Time#localtime does nothing when nothing changes. [ruby-core:87675] [Bug #14880] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-01Remove unused variablekazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-30Fix spec/ruby/command_line/rubylib_spec.rb for use with make test-speceregon
* Current code clears ENV['RUBYLIB'], but on Windows it's needed when running from build 'src' (or running make test-spec). * Patch by MSP-Greg, from https://github.com/ruby/spec/pull/607. * Imported manually to fix CI on Windows, without needing a full sync. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-28rb_enc_aliasnobu
`rb_encdb`-prefixed functions are only for internal use. use rb_enc_alias instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-28Revert "rb_enc_alias"mame
This reverts commit r63779 which made test-spec fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-28rb_enc_aliasnobu
`rb_encdb`-prefixed functions are only for internal use. use rb_enc_alias instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63779 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-28fix feature name and removed a duplicate conditionnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-28check enc_capable.ko1
* encoding.c (rb_enc_capable): make it extern to check enc_capable. enc_index can be set to limited types such as T_STRING, T_REGEX and so on. This function check an object is this kind of types. * include/ruby/encoding.h: ditto. * encoding.c (enc_set_index): check a given object is enc_capable. * include/ruby/encoding.h (PUREFUNC): * marshal.c (encoding_name): check `rb_enc_capable` first. * marshal.c (r_ivar): ditto. If it is not enc_capable, it should be malformed data. * spec/ruby/optional/capi/encoding_spec.rb: remove tests depending on the wrong feature: all objects can set enc_index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Update to ruby/spec@98c7d74eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Update to ruby/spec@a454137eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Update to ruby/spec@41068a6eregon
* Only small fixes to specs from CRuby to review the diff more easily. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Update to ruby/mspec@7074b56eregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27process.c (waitpid_wait): do not set ECHILD prematurelynormal
It is possible to have both MJIT and normal child processes alive, so we cannot set ECHILD based on such a guess. We can still elide waitpid(PID <= 0) calls if we have callers in vm->waiting_pids, however. For specs, ensure Process.waitall does not leak MJIT PIDs to Rubyspace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-27Revert "spec: skip Process wait specs on MJIT"normal
This reverts r63731 (commit 359dd59db2512d801bb983f98bede4fc598f139a). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-23spec: skip Process wait specs on MJITk0kubun
until [Bug #14867] is fixed. I want to start running CI with MJIT enabled before fixing the problem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-20skip when group name is not foundnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19describe about NameError by #private_constantnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-19NULL class Data_Wrap_Struct is not allowed.ko1
* spec/ruby/optional/capi/typed_data_spec.rb: same as r63692. * spec/ruby/optional/capi/ext/typed_data_spec.c: ditto. * vm_insnhelper.h (PUSH): re-enable assertion to check hidden objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-18Removed unobservable behaviornobu
The klass for Data_Wrap_Struct can be NULL, but it MUST NOT appear in the Ruby level. It is only for the C level implementation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-17compare with correct valuesnobu
* spec/ruby/shared/rational/exponent.rb: compare with mathematically expected values without errors. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-15Remove warnings of flip-flop deprecation from tests and specsmame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63668 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-14HTTPServerException is deprecatedusa
* spec/ruby/library/net/http/HTTPClientException_spec.rb: add. * spec/ruby/library/net/http/HTTPServerException_spec.rb: check deprecated message. * spec/ruby/library/net/http/httpresponse/*_spec.rb: use HTTPClientException instead of HTTPServerException. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13* append newline at EOF.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13Update to ruby/spec@4bb0f25eregon
* Specs added by TruffleRuby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-13Update to ruby/spec@4bc7a2beregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-04String#uminus dedupes unconditionallynormal
[Feature #14478] [ruby-core:85669] Thanks-to: Sam Saffron <sam.saffron@gmail.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-06-03Add TracePoint#parametersmame
It can be used to get the parameters' information of method and block. There was no way to get block parameters. It was possible but ineffective to get method parameters via Method object: `tp.defined_class.method(tp.method_id).parameters` TracePoint#parameters allows us to get the information easily. [Feature #14694] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-30object.c: Add a new alias `then` to `Kernel#yield_self`; [Feature #14594]matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-29spec/ruby: revert r63503 and r63508nobu
When RUBY_DESCRIPTION has `+JIT` already, it will be doubled. Just fake.rb.in always has copied `RUBY_DESCRIPTION`, regardless MJIT is enabled or not. `BOOTSTRAPRUBY` is not involved. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-27Specs must keep working on older versions and other implementationseregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-24spec/ruby: fix RUBY_DESCRIPTION check with JIT enabledk0kubun
`make test-spec` adds `-r./$(arch)-fake` to pass header options. But the $(arch)-fake.rb unexpectedly modifies RUBY_DESCRIPTION and it always drops +JIT from it since the fake.rb is built with BOOTSTRAPRUBY, which can be miniruby. miniruby can't find MJIT header and thus mjit_init_p is always FALSE. So, to pass `make test-spec` with JIT enabled, we can't use RUBY_DESCRIPTION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-05-17range.c: === by cover?nobu
* range.c (range_eqq): switch `Range#===` to use `cover?` instead of `include?`. [Feature #14575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-29* spec/ruby/command_line/dash_upper_i_spec.rb: skip symlink on Windows likeusa
other specs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28Generalize the check to MRI in the -I speceregon
* The current check seems to fail with AppVeyor. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-04-28Ignore the extension of miniruby on Windows in the -I speceregon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e