From 865313dfac2f865c9a0d5855b11797d2ec4347c6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 24 Nov 2018 12:48:56 +0000 Subject: [PATCH] assertions for r65956 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 014eb5ec15..ffae04bc21 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -987,6 +987,7 @@ CODE ].each do |g| assert_equal [g], g.each_grapheme_cluster.to_a assert_equal 1, g.each_grapheme_cluster.size + assert_predicate g.dup.taint.each_grapheme_cluster.to_a[0], :tainted? end [ @@ -996,6 +997,9 @@ CODE ].each do |str, grapheme_clusters| assert_equal grapheme_clusters, str.each_grapheme_cluster.to_a assert_equal grapheme_clusters.size, str.each_grapheme_cluster.size + str.dup.taint.each_grapheme_cluster do |g| + assert_predicate g, :tainted? + end end s = ("x"+"\u{10ABCD}"*250000) @@ -1016,6 +1020,7 @@ CODE "\u{1f469 200d 2764 fe0f 200d 1f469}", ].each do |g| assert_equal [g], g.grapheme_clusters + assert_predicate g.dup.taint.grapheme_clusters[0], :tainted? end assert_equal ["\u000A", "\u0308"], "\u{a 308}".grapheme_clusters @@ -1029,12 +1034,14 @@ CODE else warning = /passing a block to String#grapheme_clusters is deprecated/ assert_warning(warning) { - s = "ABC".b + s = "ABC".b.taint res = [] assert_same s, s.grapheme_clusters {|x| res << x } + assert_equal(3, res.size) assert_equal("A", res[0]) assert_equal("B", res[1]) assert_equal("C", res[2]) + res.each {|g| assert_predicate(g, :tainted?)} } end end