ruby-changes:57982
From: Nobuyoshi <ko1@a...>
Date: Fri, 27 Sep 2019 14:03:09 +0900 (JST)
Subject: [ruby-changes:57982] 4d3502d57f (master): More tests for [Feature #16150]
https://git.ruby-lang.org/ruby.git/commit/?id=4d3502d57f From 4d3502d57f53d5cd54452d9b19475944055989f4 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Fri, 27 Sep 2019 14:01:37 +0900 Subject: More tests for [Feature #16150] diff --git a/test/ruby/test_object.rb b/test/ruby/test_object.rb index fcb6c28..013b3f0 100644 --- a/test/ruby/test_object.rb +++ b/test/ruby/test_object.rb @@ -132,6 +132,27 @@ class TestObject < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_object.rb#L132 assert_equal(0.0, nil.to_f) end + def test_nil_to_s + str = nil.to_s + assert_equal("", str) + assert_predicate(str, :frozen?) + assert_same(str, nil.to_s) + end + + def test_true_to_s + str = true.to_s + assert_equal("true", str) + assert_predicate(str, :frozen?) + assert_same(str, true.to_s) + end + + def test_false_to_s + str = false.to_s + assert_equal("false", str) + assert_predicate(str, :frozen?) + assert_same(str, false.to_s) + end + def test_not assert_equal(false, Object.new.send(:!)) assert_equal(true, nil.send(:!)) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/