ruby-changes:53742
From: nobu <ko1@a...>
Date: Sat, 24 Nov 2018 21:49:02 +0900 (JST)
Subject: [ruby-changes:53742] nobu:r65959 (trunk): assertions for r65956
nobu 2018-11-24 21:48:56 +0900 (Sat, 24 Nov 2018) New Revision: 65959 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65959 Log: assertions for r65956 Modified files: trunk/test/ruby/test_string.rb Index: test/ruby/test_string.rb =================================================================== --- test/ruby/test_string.rb (revision 65958) +++ test/ruby/test_string.rb (revision 65959) @@ -987,6 +987,7 @@ CODE https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L987 ].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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L997 ].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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1020 "\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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_string.rb#L1034 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/