Commit graph

12086 commits

Author SHA1 Message Date
Nobuyoshi Nakada
d12d53a6c8
Adjust caller's line number, expect the next line as here-doc 2019-06-29 01:30:43 +09:00
Nobuyoshi Nakada
2bb217bfb7
Removed unused variables 2019-06-28 23:21:37 +09:00
Nobuyoshi Nakada
8ec877d183
Add parentheses to suppress a warning 2019-06-28 17:10:18 +09:00
Nobuyoshi Nakada
3dba16a5d6
Test string content 2019-06-28 17:08:47 +09:00
Nobuyoshi Nakada
5331932cd2
Removed unused variables 2019-06-28 17:08:21 +09:00
Nobuyoshi Nakada
8d04f90da4
Fixed a variable name 2019-06-28 17:07:17 +09:00
Nobuyoshi Nakada
e9bce55c12
Removed excess spaces 2019-06-28 16:02:47 +09:00
Nobuyoshi Nakada
566e6b0546
Fixed name conflict between helper classes 2019-06-28 16:02:03 +09:00
Nobuyoshi Nakada
35b7e8eed8
Skip instead of return 2019-06-28 15:26:54 +09:00
Nobuyoshi Nakada
f8b528ba92
Suppress unused variable warnings 2019-06-28 15:26:25 +09:00
Nobuyoshi Nakada
11571b0e95
Use assert_separately instead of invoke_ruby 2019-06-28 15:25:29 +09:00
Nobuyoshi Nakada
e0c4cb2ea1
Define singleton method on each new objects 2019-06-28 15:22:27 +09:00
Nobuyoshi Nakada
a0c141b6d0
Suppress redefinition and void context warnings 2019-06-28 15:09:14 +09:00
Nobuyoshi Nakada
f8b64e5f2c
Use assigned local variable 2019-06-28 15:04:25 +09:00
Nobuyoshi Nakada
c52dad0ecf
Wait for the helper thread to terminate 2019-06-28 14:54:00 +09:00
Nobuyoshi Nakada
ef45fd53e4
Fixed the test-case class name for zsh 2019-06-28 14:09:17 +09:00
Kazuhiro NISHIYAMA
7eaedda557
Use block instead of explicit close 2019-06-28 12:37:36 +09:00
Kazuhiro NISHIYAMA
5627f744cc
Add require 'test/unit' 2019-06-28 12:37:07 +09:00
Nobuyoshi Nakada
3120252f01
Suppress void context warning in verbose mode 2019-06-28 12:33:24 +09:00
Nobuyoshi Nakada
dc7da30bed
Close leaked file descriptor 2019-06-28 12:31:21 +09:00
Nobuyoshi Nakada
c9bbcaccf2
Suppress unused variable warning with RUBYOPT=-w 2019-06-28 12:27:11 +09:00
Nobuyoshi Nakada
ff7f71b288
O_EXCL has no meaning for fdopen
"exclusive access mode is not supported" exception has resulted in
empty "rubyheap-*.json" files after test/objspace/test_objspace.rb.
2019-06-28 12:02:33 +09:00
Nobuyoshi Nakada
097554855c
Fix ripper fatal
* parse.y (parser_yylex): return END_OF_INPUT at unterminated here
  document instead of an error.  [Bug #15962]
2019-06-27 15:32:03 +09:00
Nobuyoshi Nakada
2a56702eee
Test for unterminated here-docs 2019-06-27 15:13:45 +09:00
Yusuke Endoh
a84a99ffab test/ruby/test_array.rb (test_sort_with_replace): run in a subprocess
This test invokes GC.start 100 times, which takes approx. six minutes in
Solaris.  This change runs the test in a separated process, which makes
GC.start faster.
2019-06-26 16:04:07 +09:00
John Hawthorn
04bc4c0662 Resize capacity for fstring
When a string is #frozen, it's capacity is resized to fit (if it is much
larger), since we know it will no longer be mutated.

    > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000))
    {"type":"STRING", "class":"0x7feaf00b7bf0", "bytesize":30, "capacity":1000, "value":"...
    > puts ObjectSpace.dump(String.new("a"*30, capacity: 1000).freeze)
    {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "bytesize":30, "value":"...

(ObjectSpace.dump doesn't show capacity if capacity is equal to bytesize)

Previously, if we dedup into an fstring, using String#-@, capacity would
not be reduced.

    > puts ObjectSpace.dump(-String.new("a"*30, capacity: 1000))
    {"type":"STRING", "class":"0x7feaf00b7bf0", "frozen":true, "fstring":true, "bytesize":30, "capacity":1000, "value":"...

This commit makes rb_fstring call rb_str_resize, the same as
rb_str_freeze does.

Closes: https://github.com/ruby/ruby/pull/2256
2019-06-26 15:01:48 +09:00
Yusuke Endoh
1cbc4f9876 test/net/imap/test_imap.rb: use Thread#stop? to wait for server thread
Still timeout occurs.  Retry for 5dd8fdd3f3.
20190625T032405Z.fail.html.gz
2019-06-25 17:22:02 +09:00
Jean Boussier
746812ee96 Do not allocate a string to check if a scalar is an integer 2019-06-25 15:56:20 +09:00
Jordan Owens
0016edbead Add test to demonstrate issue deserializing hash with ivar
Currently the elements of a hash are revived before any ivar values.
This causes an issue when the `[]=` method references an instance
variable.
2019-06-25 15:56:20 +09:00
Aaron Patterson
a53ab897c3 Round trip exception backtraces
This commit allows exception backtraces to round trip
2019-06-25 15:56:20 +09:00
Jeremy Evans
d118c84b0b Fix IO#scanf on pipes on Windows
IO.seek on a pipe on Windows raises Errno::EINVAL instead of
Errno::ESPIPE.

Fixes Ruby Bug #15199
2019-06-25 15:56:20 +09:00
NARUSE, Yui
7f64a0b4db Add new encoding CESU-8 [Feature #15931] 2019-06-24 12:58:33 +09:00
masakazutakewaka
edbad4adcc httpstatus.rb 100% coverage 2019-06-24 10:12:07 +09:00
Nobuyoshi Nakada
11a60f9bdb Remove extraneous spaces at the end of status line
Remove extraneous spaces after the status code that is
non-compliant with RFC, i.e `HTTP 200 OK `, to unnecessary
confusion for WEBrick users, by a risk that WEBrick instances in
the wild will have server responses flagged as suspicious or
malicious due to a similar bug in [Cobalt Strike
misconfiguration].

Reported by Matt Tennis <mtennis@paloaltonetworks.com>

[Cobalt Strike misconfiguration]: https://blog.fox-it.com/2019/02/26/identifying-cobalt-strike-team-servers-in-the-wild/
2019-06-24 10:11:47 +09:00
Luke Gruber
ec8e5f5aa6
array.c: always check frozenness in Array#unshift. Fixes [Bug #15952]
Closes: https://github.com/ruby/ruby/pull/2251
2019-06-23 08:05:13 +09:00
Nobuyoshi Nakada
3840791b7e
Get rid of error with frozen string literal
[Bug #14194]
2019-06-23 07:56:43 +09:00
Nobuyoshi Nakada
bebe8d13f8
Disable frozen-string-literal to disable deduplication
[Bug #14194]
2019-06-23 07:42:11 +09:00
MSP-Greg (Greg L)
2ad7a7f801
Get rid of error with frozen string literal
[Bug #14194]
2019-06-23 07:36:26 +09:00
Nobuyoshi Nakada
9384383019
Module#constant_source_location [Feature #10771] 2019-06-23 01:46:38 +09:00
Luke Gruber
c033dc3073
Fix issue with Array#rindex when rb_equal modifies receiver array
Fixes [Bug #15951]

Closes: https://github.com/ruby/ruby/pull/2250
2019-06-23 00:49:24 +09:00
Nobuyoshi Nakada
f3c81b4e90
Frozen objects in WeakMap
* gc.c (wmap_aset): bypass check for frozen and allow frozen
  object in WeakMap.  [Bug #13498]
2019-06-23 00:31:16 +09:00
Nobuyoshi Nakada
f5e2904471
Use EXEEXT
* test/lib/minitest/unit.rb (MiniTest::Assertions.diff): use
  `EXEEXT` configured value instead of switching by hard coded
  `host_os`.
2019-06-22 23:48:21 +09:00
Nobuyoshi Nakada
bad66f3e36
Show timed out threads
* test/lib/test/unit/assertions.rb (assert_join_threads): kill and
  show timed out threads.
2019-06-22 18:39:06 +09:00
Nobuyoshi Nakada
4d650bc257
Fix over-expansion
* test/lib/minitest/unit.rb (MiniTest::Assertions#mu_pp_for_diff):
  do not expand escaped backslash followed by 'n'.
2019-06-22 09:29:33 +09:00
Shugo Maeda
38ccb8f747
Remove a duplicate test 2019-06-21 18:02:24 +09:00
Shugo Maeda
702cf3ec90
Enumerator::Lazy should support filter_map
Fixes [Bug #15949]
2019-06-21 17:42:27 +09:00
Jean Boussier
fb85a42860
Add an optional inherit argument to Module#autoload?
[Feature #15777]

Closes: https://github.com/ruby/ruby/pull/2173
2019-06-21 17:28:37 +09:00
Nobuyoshi Nakada
06a622b76e
Lazy filter_map 2019-06-21 16:28:39 +09:00
Nobuyoshi Nakada
1f0762ad21
Suppress messages from mkmf 2019-06-20 20:51:33 +09:00
Nobuyoshi Nakada
3077cb6912
Restore $VERBOSE 2019-06-20 18:20:38 +09:00