1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

27 commits

Author SHA1 Message Date
yugui
a6c69a7d35 * test/ruby/test_m17n_comb.rb: feature changed in r20626.
follows it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-13 04:45:56 +00:00
akr
43f77aaf1a revert previous commit.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-08 13:13:35 +00:00
akr
d245085630 add an assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-08 10:06:43 +00:00
matz
f2f2cd5bc6 * string.c (rb_str_comparable): string comparison should be
transitive.  [ruby-dev:36484]

* test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_eq): test
  updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-06 03:22:56 +00:00
akr
bd421aa2d2 * string.c (rb_str_sub_bang): fix coderange.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-02 11:46:40 +00:00
akr
ad50e0edb9 add a test. cf. [ruby-dev:36484].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24 12:29:01 +00:00
matz
c3e2e0e53f * string.c (rb_str_comparable): make ascii8bit string to be
compatible with any other encoding.

* string.c (rb_str_cmp): use rb_str_comparable() instead of
  rb_enc_compatible() since <=> is a comparison anyway.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-18 13:17:41 +00:00
matz
d5ec36c486 * transcode.c: add "Error" suffix for Encoding exception classes.
a patch from Tadashi Saito <shiba at mail2.accsnet.ne.jp> in
  [ruby-dev:36346].

* encoding.c (Init_Encoding): rename EncodingCompatibilityError to
  Encoding::CompatibilityError.  [ruby-dev:36366]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-18 08:57:33 +00:00
matz
377eb14a9f * string.c ():
* string.c ():

* string.c (single_byte_optimizable): make function inline.  based
  on a patch from Michael Selig <michael.selig at fs.com.au> in
  [ruby-core:18532].

* string.c (str_modify_keep_cr): new function act as
  rb_str_modify(), but don't clear coderange

* string.c (rb_str_casecmp): specialized for single byte strings.

* string.c (rb_str_splice): preserve coderange.

* string.c (rb_str_slice_bang, rb_str_reverse_bang,
  rb_str_upcase_bang, rb_str_downcase_bang, tr_trans,
  rb_str_capitalize_bang, rb_str_swapcase_bang,
  rb_str_delete_bang, rb_str_chop_bang, rb_str_chomp_bang,
  rb_str_lstrip_bang, rb_str_rstrip_bang): ditto.

* string.c (rb_str_clear): preset coderange.

* string.c (rb_str_split_m): specialized for splitting with a
  string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16 00:47:20 +00:00
kazu
60bc53a161 * test/ruby/test_m17n_comb.rb (TestM17NComb#test_str_crypt): add key and salt to error message.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18754 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 11:25:12 +00:00
naruse
85c41f4fbc * error.c (rb_eEncCompatError): add Exception.
* include/ruby/ruby.h: ditto.

* encoding.c (rb_enc_check): use rb_eEncCompatError.

* string.c (rb_enc_cr_str_buf_cat): ditto.

* string.c (rb_str_sub_bang): ditto.

* string.c (rb_str_hex): ditto.

* string.c (rb_str_oct): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-12 18:17:05 +00:00
akr
2ca7298386 test_str_slice! refactored.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-05 12:33:55 +00:00
matz
60219a0aa3 * string.c (tr_trans): should squeeze properly. [ruby-dev:34587]
* string.c (tr_trans): had a bug in treating multi-byte character
  replacement. 

* string.c (rb_str_delete_bang): need not to do anything for empty
  strings. 

* test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_delete): add
  test for empty receiver.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16317 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-07 16:15:45 +00:00
matz
6b36f117f2 * prelude.rb (require_relative): move require_relative from
lib/require_relative.rb.  [ruby-core:16356]

* lib/require_relative.rb: removed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-12 14:50:18 +00:00
matz
bbc2f80a32 * re.c (rb_reg_regsub): remove too strict encoding check.
[ruby-dev:33966]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-03 08:22:18 +00:00
akr
00bf4e8a84 * test/ruby/allpairs.rb: new file for all pairs method.
* test/ruby/test_m17n_comb.rb: use allpairs.rb to reduce test cases.

* test/ruby/test_sprintf_comb.rb: ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-03-01 04:12:13 +00:00
matz
99de7f24f7 * test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_chomp): test
updated.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15644 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 14:57:04 +00:00
matz
deff2a3e24 * string.c (rb_str_rpartition): calculation was done in byte indexing.
* test/ruby/test_m17n_comb.rb (TestM17NComb::test_str_start_with):
  allow start_with? matching on broken strings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-29 06:19:21 +00:00
akr
b8fd2fabbe * re.c (rb_reg_prepare_re): add enable_warning parameter.
(rb_reg_adjust_startpos): disable warning by rb_reg_prepare_re.
  (rb_reg_search): follow rb_reg_prepare_re parameter change.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-17 12:54:17 +00:00
akr
b1e6c052cd * string.c (rb_str_succ): don't increment/decrement codepoint.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27 08:21:24 +00:00
akr
3f68c10536 tests refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-27 02:38:10 +00:00
akr
0dfda18777 add tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-26 22:48:12 +00:00
akr
25fc9d25f7 fix previous change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23 15:34:31 +00:00
akr
da8e083ba6 test refined.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23 14:37:20 +00:00
akr
bbb7151467 add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23 09:25:17 +00:00
akr
8987b97ca9 * include/ruby/encoding.h (rb_enc_str_buf_cat): declared.
* string.c (coderange_scan): extracted from rb_enc_str_coderange.
  (rb_enc_str_coderange): use coderange_scan.
  (rb_str_shared_replace): copy encoding and coderange.
  (rb_enc_str_buf_cat): new function for linear complexity string
  accumulation with encoding.
  (rb_str_sub_bang): don't conflict substituted part and replacement.
  (str_gsub): use rb_enc_str_buf_cat.
  (rb_str_clear): clear coderange.

* re.c (rb_reg_regsub): use rb_enc_str_buf_cat.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06 09:25:09 +00:00
akr
b3b0fa3e85 split combinational tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05 19:14:24 +00:00