diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2021-11-16 11:33:39 +0100 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2021-11-17 06:38:03 +0900 |
commit | 1af8ed5f0a2c381c5dee4a5bcffff61f270c30d9 (patch) | |
tree | cd3e1ccfee9d0405e5b5a5ad3cf216102cfaa7c5 /test/ruby/test_time.rb | |
parent | 5b6a397f3e73e58d585c01ac2e3908cfac873c8c (diff) | |
download | ruby-1af8ed5f0a2c381c5dee4a5bcffff61f270c30d9.tar.gz |
`Primitive.mandatory_only?` consider splat args
`vm_ci_argc` gives the number of arguments, but `*[1, 2, 3]` only
counts for one.
Diffstat (limited to 'test/ruby/test_time.rb')
-rw-r--r-- | test/ruby/test_time.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_time.rb b/test/ruby/test_time.rb index 702bd07094..c6736750d5 100644 --- a/test/ruby/test_time.rb +++ b/test/ruby/test_time.rb @@ -241,6 +241,10 @@ class TestTime < Test::Unit::TestCase assert_equal(1, Time.at(0, 0.001).nsec) end + def test_at_splat + assert_equal(Time.at(1, 2), Time.at(*[1, 2])) + end + def test_at_with_unit assert_equal(123456789, Time.at(0, 123456789, :nanosecond).nsec) assert_equal(123456789, Time.at(0, 123456789, :nsec).nsec) |