summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* test modified.akr2008-09-101-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/uri/common.rb (URI::Parser): new class.akira2008-09-102-71/+71
| | | | | | | | | | * lib/uri/mailto.rb, lib/uri/generic.rb: follow the above change. * test/uri/test_parser.rb: added tests for URI::Parser. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (econv_after_output): renamed fromakr2008-09-091-28/+28
| | | | | | | | | | | | | econv_output_followed_by_input. (ECONV_AFTER_OUTPUT): renamed from ECONV_OUTPUT_FOLLOWED_BY_INPUT. * transcode.c: follow the renaming. * io.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (io_fwrite): raise an error if ASCII incompatible stringakr2008-09-091-31/+184
| | | | | | | | | written for text mode IO without encoding conversion. (rb_io_extract_modeenc): binmode requirement changed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_DECORATOR_MASK): mergeakr2008-09-091-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | ECONV_ENCODER_MASK and ECONV_DECORATOR_MASK. (ECONV_UNIVERSAL_NEWLINE_DECORATOR): renamed from ECONV_UNIVERSAL_NEWLINE_DECODER. (ECONV_CRLF_NEWLINE_DECORATOR): renamed from ECONV_CRLF_NEWLINE_ENCODER. (ECONV_CR_NEWLINE_DECORATOR): renamed from ECONV_CR_NEWLINE_ENCODER. (ECONV_XML_TEXT_DECORATOR): renamed from ECONV_XML_TEXT_ENCODER. (ECONV_XML_ATTR_CONTENT_DECORATOR): renamed from ECONV_XML_ATTR_CONTENT_ENCODER. (ECONV_STATEFUL_DECORATOR_MASK): renamed from ECONV_STATEFUL_ENCODER_MASK. (ECONV_XML_ATTR_QUOTE_DECORATOR): renamed from ECONV_XML_ATTR_CONTENT_DECORATOR. * io.c: follow the renaming. * transcode.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/openssl/test_ssl.rb (OpenSSL#test_client_session):kazu2008-09-091-1/+4
| | | | | | | | Debian's openssl 0.9.8g-13 failed at assert(ssl.session_reused?), when use default SSLContext. [ruby-dev:36167] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.akr2008-09-081-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_decorate_at_first): declared.akr2008-09-081-3/+3
| | | | | | | | | | | | | | | | | | | | (rb_econv_decorate_at_last): declared. * transcode.c (rb_econv_open_by_transcoder_entries): initialize replacement_enc. allocate outbuf for the last transcoder. (rb_econv_open0): extracted from rb_econv_open. (rb_econv_open): use rb_econv_open0 and decorate the result using rb_econv_decorate_at_first and rb_econv_decorate_at_last. (rb_econv_decorate_at): new function. (rb_econv_decorate_at_first): ditto. (rb_econv_decorate_at_last): ditto. (rb_econv_binmode): fix iteration end condition. (econv_init): don't set source_encoding_name and destination_encoding_name because they are set in rb_econv_open0. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-09-081-0/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_asciicompat_encoding): renamedakr2008-09-081-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from rb_econv_stateless_encoding to apply stateless ASCII incompatible encodings such as UTF-16BE. * io.c (make_writeconv): use rb_econv_asciicompat_encoding. * transcode_data.h (rb_transcoder_asciicompat_type_t): renamed from rb_transcoder_stateful_type_t. (rb_transcoder): use rb_transcoder_asciicompat_type_t. * transcode.c: follow the type change. (asciicompat_encoding_i): renamed from stateless_encoding_i. (rb_econv_asciicompat_encoding): renamed from rb_econv_stateless_encoding. (econv_s_asciicompat_encoding): method renamed. * tool/transcode-tblgen.rb: follow the type change. * enc/trans/utf_16_32.trans: follow the type change. rb_from_UTF_16BE to UTF-8 is asciicompat_decoder. rb_from_UTF_16LE to UTF-8 is asciicompat_decoder. rb_from_UTF_32BE to UTF-8 is asciicompat_decoder. rb_from_UTF_32LE to UTF-8 is asciicompat_decoder. UTF-8 to rb_to_UTF_16BE is asciicompat_encoder. UTF-8 to rb_to_UTF_16LE is asciicompat_encoder. UTF-8 to rb_to_UTF_32BE is asciicompat_encoder. UTF-8 to rb_to_UTF_32LE is asciicompat_encoder. * enc/trans/newline.trans: follow the type change. universal newline decoder is asciicompat_converter. * enc/trans/escape.trans: follow the type change. * enc/trans/iso2022.trans: ditto. * enc/trans/japanese.trans: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/cgi/test_cgi_tag_helper.rb : fix class namexibbar2008-09-081-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19248 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_insert_output): "readagain" part should beakr2008-09-081-0/+5
| | | | | | | after replacement. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_io.rb (TestIO#test_dup): add open in block.kazu2008-09-081-0/+4
| | | | | | | see [ruby-dev:35957]. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * rational.c: removed unused code.tadf2008-09-072-15/+41
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/iso2022.trans: stateless-iso-2022-jp is defined to avoidakr2008-09-071-2/+2
| | | | | | | | | | | undefined conversion error between iso-2022-jp and the corresponding stateless encoding. * enc/emacs_mule.c: replicate emacs-mule as stateless-iso-2022-jp. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_XML_ATTR_CONTENT_ENCODER): defined.akr2008-09-072-9/+40
| | | | | | | | | | | | | | | | | | | | (ECONV_STATEFUL_ENCODER_MASK): defined. (ECONV_XML_ATTR_QUOTE_ENCODER): defined. (ECONV_XML_ATTR_ENCODER): removed. * enc/trans/escape.trans (rb_escape_xml_attr_content): defined. (rb_escape_xml_attr_quote): defined. (rb_escape_xml_attr): removed. * io.c (NEED_WRITECONV): writeconv is required if supplemental converter is used. (make_writeconv): apply stateful encoder in writeconv. * transcode.c: follow the constant change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_parse.rb (TestParse): update a test not to usematz2008-09-061-3/+3
| | | | | | recently fixed inconsistent syntax. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_ERROR_HANDLER_MASK): defined.akr2008-09-061-0/+22
| | | | | | | | | | | | (ECONV_DECODER_MASK): defined. (ECONV_ENCODER_MASK): defined. * io.c (make_writeconv): restrict ecflags for writeconv with ECONV_ERROR_HANDLER_MASK. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_XML_TEXT_ENCODER): renamed fromakr2008-09-061-16/+16
| | | | | | | | | | | | | ECONV_HTML_TEXT_ENCODER. (ECONV_XML_ATTR_ENCODER): renamed from ECONV_HTML_ATTR_ENCODER. * enc/trans/escape.trans: follow the renaming. * transcode.c: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (str_transcode0): check ECONV_HTML_TEXT_ENCODER andakr2008-09-061-0/+3
| | | | | | | ECONV_HTML_ATTR_ENCODER. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (sym_html): new variable.akr2008-09-061-0/+7
| | | | | | | | | | (sym_text): ditto. (sym_attr): ditto. (econv_opts): check :html=>:text and :html=>:attr. (Init_transcode): initialize the above variables. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_HTML_TEXT_ENCODER): new constant.akr2008-09-061-0/+14
| | | | | | | | | | | | | (ECONV_HTML_ATTR_ENCODER): ditto. * transcode.c (rb_econv_open): check ECONV_HTML_TEXT_ENCODER and ECONV_HTML_ATTR_ENCODER. (Init_transcode): Encoding::Converter::HTML_TEXT_ENCODER and Encoding::Converter::HTML_ATTR_ENCODER defined. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (stateless_encoding_i): ignore supplemental conversions.akr2008-09-061-0/+1
| | | | | | | | Encoding::Converter.stateless_encoding("html-attr-escaped") should be nil. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/escape.trans (escape_html_attr_init): new function.akr2008-09-061-2/+18
| | | | | | | | | | (fun_so_escape_html_attr): new function. (escape_html_attr_finish): new function. (rb_escape_html_attr): use them to quote the converted result. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add a test.akr2008-09-051-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * complex.c: uses f_real_p macro.tadf2008-09-052-0/+17
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a test for previous commit.akr2008-09-051-0/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (rb_econv_open): fail for ASCII incompatible withakr2008-09-051-0/+22
| | | | | | | newline conversion. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_extract_modeenc): raise an error for ASCII incompatibleakr2008-09-051-4/+54
| | | | | | | encoding without binmode. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/escape.trans: new file.akr2008-09-051-0/+14
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (output_hex_charref): upcase hexadecimal digits.akr2008-09-051-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_UNDEF_HEX_CHARREF): defined.akr2008-09-051-0/+15
| | | | | | | | | | | * transcode.c (output_hex_charref): new function. (rb_econv_convert): call output_hex_charref if ECONV_UNDEF_HEX_CHARREF. (Init_transcode): Encoding::Converter::UNDEF_HEX_CHARREF added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (econv_s_stateless_encoding): new method.akr2008-09-051-0/+9
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-09-051-0/+38
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (copy_stream_fallback_body): use read method unless readpartialnobu2008-09-051-2/+2
| | | | | | | is available. [ruby-dev:36124] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (sym_partial_input): new variable.akr2008-09-041-31/+31
| | | | | | | (econv_primitive_convert): accept a hash as 5th argument as well. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * transcode.c (sym_universal_newline_decoder): new variable.akr2008-09-041-9/+9
| | | | | | | | | | (sym_crlf_newline_encoder): ditto. (sym_cr_newline_encoder): ditto. (econv_opts): check newline converter options. (econv_init): make 3rd argument hash/nil only. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (ECONV_INVALID_IGNORE): removed becauseakr2008-09-043-20/+20
| | | | | | | | | | | | | | | it tend to cause security problem. If the behaviour is really required, ECONV_INVALID_REPLACE with empty string can be used. For example, CVE-2006-2313, CVE-2008-1036, [ruby-core:15645] (ECONV_UNDEF_IGNORE): ditto. * transcode.c (rb_econv_convert): follow the above change. (econv_opts): ditto. (Init_transcode): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add tests.akr2008-09-031-0/+15
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/io.h (rb_io_t): new fields: encs.ecopts andakr2008-09-033-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | writeconv_pre_ecopts. (MakeOpenFile): initialize them. * include/ruby/encoding.h (rb_str_transcode): take ecopts argument. (rb_econv_flags): removed. (rb_econv_prepare_opts): declared. (rb_econv_open_opts): declared. * io.c (make_writeconv): use rb_econv_open_opts. (make_readconv): ditto. (io_fwrite): follow rb_str_transcode change. (rb_io_extract_modeenc): use rb_econv_prepare_opts. (rb_file_open_generic): initialize encs.ecopts. (rb_file_open_internal): ditto. (rb_io_reopen): ditto. (argf_ecopts): defined. (argf_next_argv): set encs.ecopts. (io_encoding_set): use rb_econv_prepare_opts. (argf_set_encoding): set argf_ecopts. * gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts in T_FILE. * transcode.c (transcode_loop): take ecopts argument. use rb_econv_open_opts. (rb_econv_flags): removed. (rb_econv_prepare_opts): defined. (rb_econv_open_opts): defined. (str_transcode0): take ecopts. (str_transcode): use rb_econv_prepare_opts. (rb_str_transcode): take ecopts. (econv_init): accept hash argument. (econv_insert_output): follow rb_str_transcode change. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_econv_set_replacemenet): declared.akr2008-09-031-0/+14
| | | | | | | | | | | | | | | | | * transcode.c (rb_econv_t): new fields: replacement_str, replacement_len, replacement_enc and replacement_allocated. (get_replacement_character): make len as size_t. (rb_econv_open_by_transcoder_entries): initialize the new fields. (rb_econv_close): deallocate replacement_str if it allocated. (make_replacement): new function. (output_replacement_character): use make_replacement. (rb_econv_set_replacemenet): defined. (econv_get_replacement): new method. (econv_set_replacement): new method. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/etc/test_etc.rb (test_getpwuid, test_getgrgid): usemame2008-09-031-2/+2
| | | | | | | | Process.euid and egid instead of Etc.getlogin to identify current user which may be different from a login one (e.g., su command). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/etc/test_etc.rb: check only typical use ofmame2008-09-031-46/+8
| | | | | | | setpwent/getpwent/endpwent and setgrent/getgrent/endgrent. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/mathn.rb (Integer): moved into prime.rb.yugui2008-09-031-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Prime): ditto. * lib/prime.rb (Integer): moved from mathn.rb. (Integer.each_prime): added. (Integer#prime?): added. (Prime): moved from mathn.rb. Its implmentation was rewritten. see [ruby-dev:35863]. And patched by Keiju ISHITSUKA <keiju@ishitsuka.com>, see [ruby-dev:36128]. (Prime.new): obsolete. (Prime.instance): added. (Prime.each): added. (Prime.int_from_prime_division): added. (Prime.prime_division): added. (Prime.prime?): added. Patch by TOYOFUKU Chikanobu <nobu_toyofuku at nifty.com> in [ruby-dev:36067]. (Prime.cache): removed. (Prime.primes): removed. (Prime.primes_so_far): removed. (Prime#int_from_prime_division): added. (Prime#prime_division): added. (Prime#prime?): added. (Prime#primes): removed. (Prime#primes_so_far): removed. (Prime::PseudoPrmeGenerator): added. (Prime::EratosthenesGenerator): added. (Prime::TrialDivisionGenerator): added. (Prime::Generator23): added. (Prime::TrialDivision): added. Extracted from the previous implementation of Prime by Keiju ISHITSUKA. (Prime::EratosthenesSieve): added. * lib/.document (prime.rb): added * lib/README (prime.rb): added * test/test_prime.rb: added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/scanf.rb: fixed bug involving matching literal '['dblack2008-09-031-0/+7
| | | | | | | | * test/scanf/test_scanf.rb: added test for scanf.rb fix git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/trans/japanese.trans: new file.akr2008-09-032-0/+72
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_thread.rb: fix test.ko12008-09-031-1/+1
| | | | | | | | [ruby-dev:35960] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/rexml/document.rb: limit entity expansion.shugo2008-09-011-0/+83
| | | | | | | | * lib/rexml/entity.rb: ditto. * test/rexml/test_document.rb: ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19033 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * enc/euc_jp.c (euc-jp-ms): euc-jp-ms is not EUC-JP not an alias ofnaruse2008-09-011-0/+7
| | | | | | | | | | eucJP-ms. * enc/trans/japanese.trans (eucJP-ms): eucJP-ms is the correct name of the encoding in Ruby. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_transcode.rb (test_windows_31j): added.naruse2008-09-011-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e