diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-01-06 18:58:42 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-01-06 18:58:42 +0900 |
| commit | 874797f36fe1ad459d9b678cddcd77c11afb76f1 (patch) | |
| tree | b20121b8a3dc47f9d6269ac2f0618ec532d44a40 /mrbgems/mruby-io/test | |
| parent | ccf28775b896e7cf772657eacd8727de25c3a0f4 (diff) | |
| parent | b545f62aebb38bb4dedf5e7ba1e4b780db14441e (diff) | |
| download | mruby-874797f36fe1ad459d9b678cddcd77c11afb76f1.tar.gz mruby-874797f36fe1ad459d9b678cddcd77c11afb76f1.zip | |
Merge branch 'dearblue-file-size-truncate'
Diffstat (limited to 'mrbgems/mruby-io/test')
| -rw-r--r-- | mrbgems/mruby-io/test/file.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mrbgems/mruby-io/test/file.rb b/mrbgems/mruby-io/test/file.rb index 143096759..03917ef09 100644 --- a/mrbgems/mruby-io/test/file.rb +++ b/mrbgems/mruby-io/test/file.rb @@ -80,6 +80,22 @@ assert('File#mtime') do end end +assert('File#size and File#truncate') do + fname = "#{$mrbtest_io_wfname}.resize" + begin + File.open(fname, 'w') do |f| + assert_equal 0, f.size + assert_equal 0, f.truncate(100) + assert_equal 100, f.size + assert_equal 0, f.pos + assert_equal 0, f.truncate(5) + assert_equal 5, f.size + end + ensure + File.delete(fname) + end +end + assert('File.join') do assert_equal "", File.join() assert_equal "a", File.join("a") |
