[前][次][番号順一覧][スレッド一覧]

ruby-changes:3772

From: ko1@a...
Date: Sun, 27 Jan 2008 06:24:11 +0900 (JST)
Subject: [ruby-changes:3772] akr - Ruby:r15261 (trunk): add a test for chomp.

akr	2008-01-27 06:23:59 +0900 (Sun, 27 Jan 2008)

  New Revision: 15261

  Modified files:
    trunk/test/ruby/test_utf16.rb

  Log:
    add a test for chomp.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_utf16.rb?r1=15261&r2=15260&diff_format=u

Index: test/ruby/test_utf16.rb
===================================================================
--- test/ruby/test_utf16.rb	(revision 15260)
+++ test/ruby/test_utf16.rb	(revision 15261)
@@ -37,6 +37,14 @@
     result
   end
 
+  def assert_str_equal(expected, actual, message=nil)
+    full_message = build_message(message, <<EOT)
+#{encdump expected} expected but not equal to
+#{encdump actual}.
+EOT
+    assert_block(full_message) { expected == actual }
+  end
+
   # tests start
 
   def test_utf16be_valid_encoding
@@ -112,6 +120,11 @@
     }
   end
 
+  def test_chomp
+    s = "\1\n".force_encoding("utf-16be")
+    assert_str_equal(s, s.chomp, "#{encdump s}.chomp")
+  end
+
   def test_regexp_union
     enccall(Regexp, :union, "aa".force_encoding("utf-16be"), "bb".force_encoding("utf-16be"))
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]