diff options
| author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-01 00:49:36 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2022-07-01 00:52:29 +0900 |
| commit | 302f353fd9223d020e48495eaa7a03ce5d539409 (patch) | |
| tree | 1eea0062c2ded83890afe4e5ec1755af506495f6 /test | |
| parent | b6f6fc6e870d00e5151647f3f14eaa16b8fe145b (diff) | |
[ruby/stringio] Fix the result of `StringIO#truncate` so compatible with `File`
https://github.com/ruby/stringio/commit/16847fea32
Diffstat (limited to 'test')
| -rw-r--r-- | test/stringio/test_stringio.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/stringio/test_stringio.rb b/test/stringio/test_stringio.rb index 3fcb20e1fa..34c4748185 100644 --- a/test/stringio/test_stringio.rb +++ b/test/stringio/test_stringio.rb @@ -39,11 +39,11 @@ class TestStringIO < Test::Unit::TestCase def test_truncate io = StringIO.new("") io.puts "abc" - io.truncate(0) + assert_equal(0, io.truncate(0)) io.puts "def" assert_equal("\0\0\0\0def\n", io.string, "[ruby-dev:24190]") assert_raise(Errno::EINVAL) { io.truncate(-1) } - io.truncate(10) + assert_equal(0, io.truncate(10)) assert_equal("\0\0\0\0def\n\0\0", io.string) end |
