diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-17 19:41:39 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-17 19:41:39 +0000 |
| commit | fa1d4b252ad132f0d5989cb48008148e67f7becc (patch) | |
| tree | 3548bb99192a5f6ff977a66a06a02aaadc6c56be /test/ruby | |
| parent | 08d367c60c786e221899559ccd7ba9e1b046fa4e (diff) | |
| download | ruby-fa1d4b252ad132f0d5989cb48008148e67f7becc.tar.gz ruby-fa1d4b252ad132f0d5989cb48008148e67f7becc.tar.xz ruby-fa1d4b252ad132f0d5989cb48008148e67f7becc.zip | |
* io.c (appendline): appendline cannot check character boundary.
(rb_io_getline_1): relax limit until character boundary.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_io_m17n.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/ruby/test_io_m17n.rb b/test/ruby/test_io_m17n.rb index 6cec7a05b..14d29282a 100644 --- a/test/ruby/test_io_m17n.rb +++ b/test/ruby/test_io_m17n.rb @@ -445,6 +445,22 @@ EOT } end + def test_gets_limit + with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa"; w.close + assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.gets(1)) + } + with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa"; w.close + assert_equal("\xa4\xa2".force_encoding("euc-jp"), r.gets(2)) + } + with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa"; w.close + assert_equal("\xa4\xa2\xa4\xa4".force_encoding("euc-jp"), r.gets(3)) + } + with_pipe("euc-jp") {|r, w| w << "\xa4\xa2\xa4\xa4\xa4\xa6\xa4\xa8\xa4\xaa"; w.close + assert_equal("\xa4\xa2\xa4\xa4".force_encoding("euc-jp"), r.gets(4)) + } + + end + def test_file_foreach with_tmpdir { generate_file('tst', 'a' * 8191 + "\xa1\xa1") |
