From 9cda737a5634e70d018a2c148fbcf59631591d23 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 2 Feb 2023 22:42:36 +0900 Subject: [PATCH] mruby-hash-ext/test: test Hash#compact! returns nil if unmodified --- mrbgems/mruby-hash-ext/test/hash.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mrbgems/mruby-hash-ext/test/hash.rb b/mrbgems/mruby-hash-ext/test/hash.rb index a705af658..60a2123ea 100644 --- a/mrbgems/mruby-hash-ext/test/hash.rb +++ b/mrbgems/mruby-hash-ext/test/hash.rb @@ -89,8 +89,8 @@ end assert('Hash#compact!') do h = { "cat" => "feline", "dog" => nil, "cow" => false } - h.compact! - assert_equal({ "cat" => "feline", "cow" => false }, h) + assert_equal({ "cat" => "feline", "cow" => false }, h.compact!) + assert_nil(h.compact!) end assert('Hash#fetch') do