summaryrefslogtreecommitdiff
path: root/test/drb
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2020-02-15 16:27:03 +0900
committerYusuke Endoh <mame@ruby-lang.org>2020-02-15 16:27:03 +0900
commitfb472ca7adbaceb35aae1b3a6b948720ffc9eb53 (patch)
tree3d7fc924b3d895288187c902ba4bdb32427bb177 /test/drb
parent2bcfdad006a1daac311f517110db6e221b2fa5d5 (diff)
lib/drb/drb.rb: Use ruby2_keywords for keyword separation
[Bug #16634]
Diffstat (limited to 'test/drb')
-rw-r--r--test/drb/test_drb.rb16
-rw-r--r--test/drb/ut_drb.rb12
2 files changed, 28 insertions, 0 deletions
diff --git a/test/drb/test_drb.rb b/test/drb/test_drb.rb
index b792349f28..47b2966ae2 100644
--- a/test/drb/test_drb.rb
+++ b/test/drb/test_drb.rb
@@ -349,4 +349,20 @@ class TestDRbTCP < Test::Unit::TestCase
end
end
+class TestBug16634 < Test::Unit::TestCase
+ include DRbBase
+
+ def setup
+ super
+ setup_service 'ut_drb.rb'
+ end
+
+ def test_bug16634
+ assert_equal(42, @there.keyword_test1(a: 42))
+ assert_equal("default", @there.keyword_test2)
+ assert_equal(42, @there.keyword_test2(b: 42))
+ assert_equal({:a=>42, :b=>42}, @there.keyword_test3(a: 42, b: 42))
+ end
+end
+
end
diff --git a/test/drb/ut_drb.rb b/test/drb/ut_drb.rb
index f05d3f8e1f..7c0603b009 100644
--- a/test/drb/ut_drb.rb
+++ b/test/drb/ut_drb.rb
@@ -148,6 +148,18 @@ class DRbEx
end
end
+ def keyword_test1(a:)
+ a
+ end
+
+ def keyword_test2(b: "default")
+ b
+ end
+
+ def keyword_test3(**opt)
+ opt
+ end
+
private
def call_private_method
true