aboutsummaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* * test/ruby/test_thread.rb (test_status_and_stop_p): reduce the riskmame2008-08-251-6/+9
| | | | | | | of race condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (test_dup): fix typo. see [ruby-dev:35958]mame2008-08-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_open_by_transcoder_entries): initializeakr2008-08-251-1/+41
| | | | | | | | | | | last_error. num_trans may be zero. (rb_econv_convert0): num_trans may be zero. (rb_econv_putbackable): ditto. (rb_econv_putback): ditto. (rb_econv_convert): input_ptr and output_ptr may be NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_init_copy): copy encs.akr2008-08-241-2/+29
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_s_pipe): accept optional hash.akr2008-08-241-0/+38
| | | | | | | | | | | | | | | | (rb_io_set_encoding): ditto. (rb_io_extract_modeenc): use rb_econv_opts to initialize ecopts. (rb_file_open_generic): ditto. (rb_file_open_internal): ditto. (io_encoding_set): new argument: opt. (argf_set_encoding): copy fptr->encs.opts to argf_ecopts. * transcode.c (rb_econv_opts): accept Qnil for initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_str_transcode): add ecflags argument.akr2008-08-241-0/+63
| | | | | | | | | | | | | | | | | | | | * transcode.c (econv_opts): extracted from str_transcode. (str_transcode_enc_args): extracted from str_transcode. (str_transcode0): extracted from str_transcode. (str_transcode): use econv_opts, str_transcode_enc_args, str_transcode0. (rb_str_transcode): call str_transcode0. (econv_primitive_insert_output): give the additional argument for rb_str_transcode. * io.c (make_writeconv): use invalid/undef flags. (io_fwrite): ditto. (rb_scan_open_args): give the additional argument for rb_str_transcode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_open_exc): declared.akr2008-08-242-5/+5
| | | | | | | | | | | | | * transcode.c (rb_eNoConverter): new exception. (rb_econv_open_exc): new function. (transcode_loop): use rb_econv_open_exc. * io.c (make_writeconv): use rb_econv_open_exc. (make_readconv): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_process.rb (TestProcess#test_rlimit_value): add ↵kazu2008-08-231-2/+2
| | | | | | Errno::EINVAL. [ruby-dev:35900] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (FMODE_INVALID_MASK): defined.akr2008-08-231-0/+39
| | | | | | | | | | | | | | | | | | | | | (FMODE_INVALID_IGNORE): defined. (FMODE_INVALID_REPLACE): defined. (FMODE_UNDEF_MASK): defined. (FMODE_UNDEF_IGNORE): defined. (FMODE_UNDEF_REPLACE): defined. * io.c (sym_invalid): defined. (sym_undef): defined. (sym_ignore): defined. (sym_replace): defined. (make_readconv): specify ECONV_INVALID_* and ECONV_UNDEF_* if FMODE_INVALID_* and FMODE_UNDEF_* is set. (rb_io_extract_modeenc): check {:invalid, :undef} => {:replace, :ignore} for FMODE_INVALID_* and FMODE_UNDEF_*. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_INVALID_MASK): defined.akr2008-08-231-0/+33
| | | | | | | | | | | | | | | | | | | | | (ECONV_INVALID_IGNORE): defined. (ECONV_INVALID_REPLACE): defined. (ECONV_UNDEF_MASK): defined. (ECONV_UNDEF_IGNORE): defined. (ECONV_UNDEF_REPLACE): defined. * transcode.c (INVALID_IGNORE): removed. (INVALID_REPLACE): removed. (UNDEF_IGNORE): removed. (UNDEF_REPLACE): removed. (rb_econv_convert0): renamed from rb_econv_convert. (rb_econv_convert): defined to call rb_econv_convert0 with replace/ignore behavior moved from transcode_loop. (transcode_loop): replace/ignore behavior removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_extract_modeenc): check :textmode and :binmode in optionakr2008-08-231-0/+10
| | | | | | | hash. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (FMODE_TEXTMODE): defined.akr2008-08-222-0/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/ruby/encoding.h (rb_econv_t): new field: flags. (rb_econv_binmode): declared. * io.c (io_unread): text mode hack removed. (NEED_NEWLINE_DECODER): defined. (NEED_NEWLINE_ENCODER): defined. (NEED_READCONV): defined. (NEED_WRITECONV): defined. (TEXTMODE_NEWLINE_ENCODER): defined for windows. (make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for text mode. (io_fwrite): use NEED_WRITECONV. character code conversion is disabled if fptr->writeconv_stateless is nil. (make_readconv): setup converter with ECONV_UNIVERSAL_NEWLINE_DECODER for text mode. (read_all): use NEED_READCONV. (appendline): use NEED_READCONV. (rb_io_getline_1): use NEED_READCONV. (io_getc): use NEED_READCONV. (rb_io_ungetc): use NEED_READCONV. (rb_io_binmode): OS-level text mode test removed. call rb_econv_binmode. (rb_io_binmode_m): call rb_io_binmode_m with write_io as well. (rb_io_flags_mode): return mode string including "t". (rb_io_mode_flags): detect "t" for text mode. (rb_sysopen): always specify O_BINARY. * transcode.c (rb_econv_open_by_transcoder_entries): initialize flags. (rb_econv_open): if source and destination encoding is both empty string, open newline converter. last_tc will be NULL in this case. (rb_econv_encoding_to_insert_output): last_tc may be NULL now. (rb_econv_string): ditto. (output_replacement_character): ditto. (transcode_loop): ditto. (econv_init): ditto. (econv_inspect): ditto. (rb_econv_binmode): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c (nucomp_div): now behaves as quo.tadf2008-08-222-52/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * complex.c (nucomp_s_generic_p): has been removed. * complex.c (nucomp_to_s): adopts new form. * complex.c (nucomp_inspect): ditto. * complex.c (string_to_c_internal): ditto and supports polar form. * complex.c (rb_complex_polar): new. * rational.c (nurat_to_s): did not canonicalize. * rational.c (nurat_inspect): adopts new form. * rational.c (string_to_r_internal): ditto. * include/ruby/intern.h: added a declaration. * lib/complex.rb: added an obsolate class method. * lib/cmath.rb: use scalar? instead of generic?. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/server.rb (WEBrick::GenericServer#shutdown):kazu2008-08-221-1/+8
| | | | | | | | | | | | rescue Errno::ENOTCONN and close. [ruby-dev:35896] * test/openssl/test_ssl.rb (OpenSSL#start_server): ditto. [ruby-dev:35897] * lib/net/imap.rb (Net::IMAP#disconnect): ditto. [ruby-dev:35898] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime): supported flags and precision for mostnobu2008-08-221-7/+2
| | | | | | | | | | conversions. [ruby-dev:35906] * lib/date/format.rb (Date#strftime): left-justifies %L and %N. [ruby-dev:35909] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_transcode.rb: test_shift_jis:duerst2008-08-221-21/+21
| | | | | | | | fixed comment strings (see r18291) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18772 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_initialize): accept hash argument.akr2008-08-211-0/+13
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime): supported %F and %<precision>N.shugo2008-08-211-0/+12
| | | | | | | | | | reverted config.h to ruby.h for Windows. * test/ruby/test_time.rb (TestTime::test_strftime): added tests for %F and %N. * time.c: documented %F and %N. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_crypt): add key and ↵kazu2008-08-211-1/+1
| | | | | | salt to error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * file.c (rb_stat_inspect): don't raise if self is not initialized.akr2008-08-211-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * process.c (pst_pid): use rb_attr_get to avoid warning onakr2008-08-211-0/+3
| | | | | | | | Process::Status.allocate.pid. (pst_inspect): don't raise if self is not initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_extract_encoding_option): if internal encoding is notakr2008-08-211-2/+278
| | | | | | | specified, enc is external encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test O_NOFOLLOW only on FreeBSD and Linux.akr2008-08-211-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c (rb_strftime): return "UTC" instead of "GMT".shugo2008-08-211-1/+1
| | | | | | | * test/ruby/test_time.rb (test_strftime): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/iconv/test_option.rb (test_ignore_option): skip if iconvnaruse2008-08-201-2/+12
| | | | | | | | doesn't have transliterate. * test/iconv/test_option.rb (test_translit_option): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/scanf.rb (Scanf::FormatSpecifier#initialize): %i should acceptnobu2008-08-201-2/+2
| | | | | | | single digit decimal. [ruby-core:18355] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.akr2008-08-201-0/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * strftime.c: new file.shugo2008-08-201-0/+4
| | | | | | | | | | * common.mk (COMMONOBJS): added strftime.$(OBJEXT). * time.c (time_strftime): do not use strftime(3). supported %L(millisecond) and %N(nanosecond). * test/ruby/test_time.rb: added tests for %L and %N. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18731 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.akr2008-08-201-0/+18
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* mkcdtmpdir doesn't yield a value.akr2008-08-191-9/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_open_file): encoding in mode string was ignored if perm isakr2008-08-181-0/+9
| | | | | | | specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_inspect): don't raise for uninitialized Regexp.akr2008-08-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_check_readable): side effect for STDIN removed.akr2008-08-181-0/+19
| | | | | | | (rb_io_external_encoding): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_ungetbyte): renamed from io_ungetc.akr2008-08-181-8/+24
| | | | | | | | (rb_io_ungetbyte): new method. (rb_io_ungetc): push back into character buffer if enc2 is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: writeconv,akr2008-08-181-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writeconv_stateless and writeconv_initialized. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_econv_stateless_encoding): declared. (rb_econv_string): declared. * io.c (make_writeconv): new function. (io_fwrite): use econv. (make_readconv): fix error message. (finish_writeconv): new function. (fptr_finalize): call finish_writeconv. (clear_writeconv): new function. (clear_codeconv): new function to call both clear_readconv and clear_writeconv. (rb_io_fptr_finalize): call clear_codeconv instead of clear_readconv. (mode_enc): ditto. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. * gc.c (gc_mark_children): mark writeconv_stateless in T_FILE. * transcode.c (stateless_encoding_i): new function. (rb_econv_stateless_encoding): ditto. (rb_econv_string): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (clear_readconv): extracted from rb_io_fptr_finalize.akr2008-08-181-0/+49
| | | | | | | | | | (mode_enc): call clear_readconv. (io_set_encoding): ditto. (argf_next_argv): ditto. (io_encoding_set): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_shift_crbuf): add strp argument to append into existingakr2008-08-181-0/+71
| | | | | | | | | string. (read_all): use econv if enc2 is set. (io_getc): follow the io_shift_crbuf change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_enc_str_converted): new function.akr2008-08-181-7/+5
| | | | | | | | | | | | | (make_readconv): extracted from io_getc. (more_char): ditto. (appendline): use econv via make_readconv and more_char for code conversion. (prepare_getline_args): don't convert record separator. (rb_io_getline_1): don't use rb_io_getline_fast if enc2 is set. (io_getc): use make_readconv and more_char. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-08-181-5/+19
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (appendline): appendline cannot check character boundary.akr2008-08-171-0/+16
| | | | | | | (rb_io_getline_1): relax limit until character boundary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/webrick/cgi.rb (WEBrick::CGI::Socket#eof?): added lacked method.gotoyuzo2008-08-171-3/+26
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (prepare_getline_args): io.gets(10,nil) should cause TypeError.akr2008-08-171-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_primitive_putback): new method.akr2008-08-171-0/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_putbackable): declared.akr2008-08-171-0/+10
| | | | | | | | | | | | | (rb_econv_putback): ditto. * transcode.c (rb_econv_putbackable): implemented. (rb_econv_putback): ditto. * io.c (io_getc): put back bytes if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (make_econv_exception): add several instance variablesakr2008-08-171-0/+19
| | | | | | | | | | | | | | | | | to exception object. (ecerr_source_encoding): new method: Encoding::ConversionUndefined#source_encoding and Encoding::InvalidByteSequence#source_encoding. (ecerr_destination_encoding): new method: Encoding::ConversionUndefined#destination_encoding and Encoding::InvalidByteSequence#destination_encoding. (econverr_error_char): new method: Encoding::ConversionUndefined#error_char. (econverr_error_bytes): new method: Encoding::ConversionUndefined#error_bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/iconv/test_option.rb (test_ignore_option): skip if iconvnaruse2008-08-161-0/+2
| | | | | | | | doesn't have transliterate. * test/iconv/test_option.rb (test_translit_option): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: readconv, crbuf, crbuf_off,akr2008-08-161-6/+4
| | | | | | | | | | | | | crbuf_len, crbuf_capa. (MakeOpenFile): initialize them. * io.c (io_shift_crbuf): new function. (io_getc): use econv. (rb_io_fptr_finalize): finalize readconv and crbuf. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_t): add fields: in_buf_start,akr2008-08-161-25/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in_data_start, in_data_end, in_buf_end and last_trans_index. (rb_econv_output): removed. (rb_econv_insert_output): declared. (rb_econv_encoding_to_insert_output): declared. * enc/trans/newline.trans (rb_universal_newline): stateful_type changed. * transcode.c (transcode_restartable0): initialize inchar_start, tc->recognized_len and next_table at beginning of the loop. (rb_econv_open_by_transcoder_entries): initialize new fields. (rb_econv_open): setup last_trans_index. (trans_sweep): last out_buf_start can be non-NULL now. (rb_econv_convert): check last out_buf_start and in_buf_start at first. (rb_econv_output_with_destination_encoding): removed. (econv_just_convert): removed. (rb_econv_output): removed. (econv_primitive_output): method removed. (rb_econv_encoding_to_insert_output): new function. (allocate_converted_string): new function. (rb_econv_insert_output): new function. (econv_primitive_insert_output): new method. (output_replacement_character): use rb_econv_insert_output. unused arguments removed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.akr2008-08-151-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_just_convert): extracted from rb_econv_output.akr2008-08-151-0/+34
| | | | | | | | (rb_econv_output): use econv_just_convert. (econv_primitive_output): new method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e