aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_argf.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_getpartial): should not resize str if the secondshugo2015-11-251-0/+11
| | | | | | | argument is not given. [ruby-core:71668] [Bug #11738] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: check ARGV element typenobu2015-10-221-0/+8
| | | | | | | * io.c (argf_next_argv): check ARGV element type, and try conversion if necessary. [ruby-core:71140] [Bug #11610] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c (argf_read_nonblock): support `exception: false'normal2015-07-171-0/+43
| | | | | | | | | | | | | | | | | This is a preparation for [ruby-core:69892] ("io.c: avoid kwarg parsing in C API") since I noticed ARGF.read_nonblock did not properly catch up to the `exception: false' change. * io.c (argf_read_nonblock): support `exception: false' (io_nonblock_eof): new function (io_read_nonblock): use io_nonblock_eof (argf_getpartial): accept kwargs hash for `exception: false' * test/ruby/test_argf.rb (test_read_nonblock): new test [ruby-core:70000] [Feature #11358] * NEWS: add item for ARGF.read_nonblock git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/lib/envutil.rb: Moved from test/ruby/.akr2014-11-131-1/+0
| | | | | | | | | | | | | | * test/lib/find_executable.rb: Ditto. * test/lib/memory_status.rb: Ditto. * test/lib/test/unit.rb: require envutil. * test/: Don't require envutil in test files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: preserve encodingsnobu2014-08-281-0/+7
| | | | | | * io.c (argf_next_argv): preserve encodings in warning messages. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test/ruby: assert_raise_with_messagenobu2013-10-091-2/+1
| | | | | | * test/ruby: use assert_raise_with_message git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Specify external_encodingnaruse2013-03-301-6/+2
| | | | | | http://c5664.rubyci.org/~chkbuild/ruby-trunk/log/20130329T090301Z.diff.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: get rid of IOError when skipped while iterationnobu2013-03-291-0/+5
| | | | | | | | | | * io.c (argf_next_argv): set init flag if succeeded to forward, after skipping. * io.c (argf_block_call_i, argf_block_call): no more forwarding if forwarded after skipping. [ruby-list:49185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: get rid of IOError when skipped while iterationnobu2013-03-291-0/+38
| | | | | | | | | * io.c (argf_close): deal with init flag. * io.c (argf_block_call_i, argf_block_call): forward next file if skipped while iteration, to get rid of IOError. [ruby-list:49185] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_argf.rb: duplicated testnobu2012-12-241-10/+0
| | | | | | | * test/ruby/test_argf.rb (TestArgf#test_lines): remove duplicated test whose content is test_bytes actually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Deprecate #{lines,bytes,chars,codepoints} of IO-likes.knu2012-12-221-3/+31
| | | | | | | | | | | | | | | * io.c (rb_io_lines, rb_io_bytes, rb_io_chars, rb_io_codepoints): Deprecate IO#{lines,bytes,chars,codepoints} and those of ARGF. [Feature #6670] * ext/stringio/stringio.c (strio_lines, strio_bytes, strio_chars) (strio_codepoints): Deprecate StringIO#{lines,bytes,chars,codepoints}. [Feature #6670] * ext/zlib/zlib.c (rb_gzreader_lines, rb_gzreader_bytes): Deprecate Zlib::GzipReader#{lines,bytes}. [Feature #6670] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (TestArgf#test_chars): since marshal data isusa2012-11-261-2/+2
| | | | | | | binary, shouldn't pass via text mode. use base64 encoded data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_each_codepoint): add missing ARGF#codepoints [Bug #7438]naruse2012-11-261-0/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* increment @tmp_count.akr2012-07-181-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb: use temporally directory.akr2012-07-181-13/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_readpartial): Document the output buffer parameter isdrbrain2012-04-181-0/+12
| | | | | | | | | | | | | | | | | | overwritten with the read contents even when non-empty. Patch by yu nobuoka. [ruby-trunk - Bug #6285] * io.c (io_read_nonblock): ditto. * io.c (io_read): ditto. * io.c (rb_io_sysread): ditto. * io.c (argf_read): ditto. * io.c (argf_readpartial): ditto. * ext/stringio/stringio.c (strio_read): ditto. * test/ruby/test_argf.rb (class TestArgf): Add test for existing behavior of read outbuf. * test/ruby/test_io.rb (class TestIO): ditto. * test/stringio/test_stringio.rb (class TestStringIO): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): reset ARGF.next_p on ARGV.replace.naruse2012-02-021-0/+10
| | | | | | | r34409 breaks replacing ARGV. [ruby-dev:45160] [Bug #5952] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34417 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (test_readlines_twice_tty): removed incomplete test ↵nobu2012-02-011-15/+0
| | | | | | committed accidentally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_close): skip stdin, which should be readable again.nobu2012-01-311-0/+20
| | | | | | | | [ruby-dev:45160] [Bug #5952] * io.c (argf_readlines): reinitialize after all read to be readable again. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): open in default text mode.nobu2011-09-031-1/+12
| | | | | | [ruby-core:39234] [Bug #5268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * util.c, include/ruby/util.h (ruby_add_suffix): remove the function.usa2011-08-031-11/+4
| | | | | | | | | | | | | | | | | | | | | | [Bug #5153] [ruby-core:38736] * io.c (argf_next_argv): remove the call of above function. * ext/-test-/add_suffix, test/-ext-/test_add_suffix.rb: remove the test extension module because this is only for testsing ruby_add_suffix(). * LEGAL: remove the mention about a part of util.c, because now we removed the part. * io.c (argf_next_argv): now the new filename is not guranteed to use, so should check the return value of rename(2). * test/ruby/test_argf.rb (TestArgf#test_inplace_rename_impossible): now we expect same result with other platforms on no_safe_rename platforms (=Windows). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_next_argv): go advance when the next file cannot benobu2011-01-131-0/+15
| | | | | | read. [ruby-core:34446] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (test_inplace_rename_impossible): unlinkusa2010-12-141-4/+14
| | | | | | | | | | | | the renamed temporary file on no_safe_rename platforms. * test/ruby/test_argf.rb (test_readlines_limit_0, test_each_line_limit_0): should close argf because the associated Tempfile object cannot unlink the temporary file when it's gc'ed on some platforms (Windows, etc.) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_readlines): forward to current_file for argumentsnobu2010-11-141-0/+18
| | | | | | | check. http://twitter.com/nagachika/status/3634254856589312 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_getline_fast, rb_io_getline_1): fix ARGF.lineno behavior. ↵kazu2010-04-111-0/+8
| | | | | | | | [ruby-core:25205] * test/ruby/test_argf.rb (TestArgf#test_lineno3): add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove temporally files explicitly.akr2009-09-131-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* make tempfile prefix more descriptive.akr2009-09-131-6/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (assert_src_expected): refactored.nobu2009-08-311-53/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_eof): go to the next file if called after ARGF.closenobu2009-07-261-0/+12
| | | | | | | or ARGF.skip. [ruby-core:24561] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (argf_eof): should not have reached EOF before trying tonobu2009-07-251-4/+4
| | | | | | | | read. based on a patch by Heesob Park <phasis AT gmail.com> at [ruby-core:24559]. [ruby-core:24557] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (TestArgf#test_skip): updated testmatz2009-06-161-6/+2
| | | | | | according to clarified behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (test_readpartial2): readpartial works just likeusa2008-10-281-0/+2
| | | | | | | binmode, so input of it should be binmode'ed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (test_{argf,lineno,lineno2}): don't repeatnobu2008-10-271-16/+17
| | | | | | | comments and expected results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/envutil.rb (Test::Unit::Assertions#assert_in_out_err): newmame2008-07-151-118/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | method. * test/ruby/test_argf.rb: use assert_in_out_err instead of EnvUtil.rubyexec. * test/ruby/test_module.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_objectspace.rb: ditto. * test/ruby/test_object.rb: ditto. * test/ruby/test_string.rb: ditto. * test/ruby/test_method.rb: ditto. * test/ruby/test_variable.rb: ditto. * test/ruby/test_io.rb: ditto. * test/ruby/test_rubyoptions.rb: ditto. * test/ruby/test_exception.rb: ditto. * test/ruby/test_class.rb: ditto. * test/ruby/test_thread.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test for [ruby-dev:34958].akr2008-06-281-0/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb: support NO_SAFE_RENAME platforms.usa2008-06-181-11/+25
| | | | | | | * test/ruby/test_argf.rb: now tempfiles are binmode'ed to test tell/pos/etc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (test_binmode): wrong test. fixed.usa2008-06-181-3/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb (teardown): remove renamed temporary files.akr2008-06-021-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb: rename a conflicting method name.mame2008-05-301-1/+1
| | | | | | | | | * test/ruby/test_string.rb: ditto. * test/ruby/test_io.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_argf.rb: new tests for ARGF, to achieve over 85% testmame2008-05-291-0/+686
coverage of file.c. * test/ruby/test_io.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e