[前][次][番号順一覧][スレッド一覧]

ruby-changes:69698

From: Nobuyoshi <ko1@a...>
Date: Thu, 11 Nov 2021 14:00:59 +0900 (JST)
Subject: [ruby-changes:69698] 6ecd30b402 (master): [ruby/getoptlong] Save the copy of `ARGV`

https://git.ruby-lang.org/ruby.git/commit/?id=6ecd30b402

From 6ecd30b402d02a51aef1ec48072ff4d103b7ef8f Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Thu, 11 Nov 2021 11:07:26 +0900
Subject: [ruby/getoptlong] Save the copy of `ARGV`

It refers the same object and will be replaced.

https://github.com/ruby/getoptlong/commit/5f57f47572
---
 test/test_getoptlong.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/test_getoptlong.rb b/test/test_getoptlong.rb
index f3f08128710..2d496e635c4 100644
--- a/test/test_getoptlong.rb
+++ b/test/test_getoptlong.rb
@@ -5,7 +5,7 @@ class TestGetoptLong < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_getoptlong.rb#L5
 
   def verify(test_argv, expected_remaining_argv, expected_options)
     # Save ARGV and replace it with a test ARGV.
-    argv_saved = ARGV
+    argv_saved = ARGV.dup
     ARGV.replace(test_argv)
     # Define options.
     opts = GetoptLong.new(
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]