summaryrefslogtreecommitdiff
path: root/test/ruby/enc/test_case_comprehensive.rb
AgeCommit message (Collapse)Author
2023-02-27Prefer to use File.foreach instead of IO.foreachHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/7387
2021-12-29Use omit instead of skip: test/ruby/enc/**/*.rbHiroshi SHIBATA
2018-12-09implement special behavior for Georgian for String#capitalizeduerst
The modern Georgian script is special in that it has an 'uppercase' variant called MTAVRULI which can be used for emphasis of whole words, for screamy headlines, and so on. However, in contrast to all other bicameral scripts, there is no usage of capitalizing the first letter in a word or a sentence. Words with mixed capitalization are not used at all. We therefore implement special behavior for String#capitalize. Formally, we define String#capitalize as first applying String#downcase for the whole string, then using titlecase on the first letter. Because Georgian defines titlecase as the identity function both for MTAVRULI ('uppercase') and Mkhedruli (lowercase), this results in String#capitalize being equivalent to String#downcase for Georgian. This avoids undesirable mixed case. * enc/unicode.c: Actual implementation * string.c: Add mention of this special case for documentation * test/ruby/enc/test_case_mapping.rb: Add two tests, a general one that uses String#capitalize on some (including nonsensical) combinations of MTAVRULI and Mkhedruli, and a canary test to detect the potential assignment of characters to the currently open slots (holes) at U+1CBB and U+1CBC. * test/ruby/enc/test_case_comprehensive.rb: Tweak generation of expectation data. Together with r65933, this closes issue #14839. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22update unicode data files directorynobu
* test/ruby/enc/test_case_comprehensive.rb: search ucd directory first if exists. * test/ruby/enc/test_regex_casefold.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03change test class name because it is not only about foldingduerst
* test/ruby/enc/test_case_comprehensive.rb: Change test class name from TestComprehensiveCaseFold to TestComprehensiveCaseMapping because the tests are about mapping in general, not only folding git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-30fix uppercasing for U+A64B, CYRILLIC SMALL LETTER MONOGRAPH UKduerst
* enc/unicode.c: Add U+A64B to the special cases 03B9 and 03BC at the end of onigenc_unicode_case_map (Bug #12990). * enc/unicode/case-folding.rb: Add U+A64B to the special cases 03B9 and 03BC. Add a comment pointing to enc/unicode.c. Change warnings to exceptions for unpredicted cases, because this would have been more easily noticed (the warning was not noticed when upgrading to Unicode 9.0.0). * test/ruby/enc/test_case_comprehensive.rb: Remove temporary exclusion of U+A64B from testing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29get rid of ambiguous parentheses warningsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56937 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29Fix erroneous test of target against targetduerst
* test/ruby/enc/test_case_comprehensive.rb: fix test condition, add a temporary check for U+A64B, the only character where the tests currently fail. (Bug #12990) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-16* enc/windows_1254.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1254. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-30* enc/iso_8859_2.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-2, by Yushiro Ishii. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* enc/windows_1257.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1257, by Sho Koike. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* enc/windows_1250.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1250, by Sho Koike. * ChangeLog: Fixed order of previous two entries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* enc/windows_1251.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1251, by Shunsuke Sato. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* enc/windows_1251.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1251, by Shunsuke Sato. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-26* test/ruby/enc/test_case_comprehensive.rb: Add explicit skip test forduerst
availability of Unicode data files. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/iso_8859_9.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-9, by Kazuki Iijima. * enc/iso_8859_9.c: Exclude dotless i/I with dot from case-insensitive matching because they are not a case pair. * test/ruby/enc/test_iso_8859.rb: Make test coverage for ISO-8859-9 a bit more complete. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/windows_1252.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for Windows-1252, by Serina Tai. * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/iso_8859_7.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-7, by Kosuke Kurihara. * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/iso_8859_5.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-5, by Masaru Onodera. * test/ruby/enc/test_case_comprehensive.rb: Fix order of encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/iso_8859_13.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-13, by Kanon Shindo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-13* enc/iso_8859_3.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-3, by Takuya Miyamoto. * test/ruby/enc/test_case_comprehensive.rb: Extend special treatment for Turkic. * enc/iso_8859_3.c: Exclude dotless i/I with dot from case-insensitive matching because they are not a case pair. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-12* revert r55642 (previous commit) because of test failure atduerst
https://travis-ci.org/ruby/ruby/builds/144148780 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-12* enc/iso_8859_3.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-3, by Takuya Miyamoto. * test/ruby/enc/test_case_comprehensive.rb: Extend special treatment for Turkic. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-10* enc/iso_8859_10.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-10, by Toya Hosokawa. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-10* test/ruby/enc/test_case_comprehensive.rb: Changed testing logic in toduerst
catch unintended modifications of characters that do not have a case equivalent in the respective encoding. * enc/iso_8859_1.c, enc/iso_8859_15.c: Fixed unintended modifications of micro sign and y with diaeresis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-10* enc/iso_8859_4.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-4, by Kotaro Yoshida. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-10git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55622 ↵duerst
b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06* enc/iso_8859_14.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-14, by Yutaro Tada. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06* enc/iso_8859_15.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-15, by Maho Harada. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55591 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-06* enc/iso_8859_16.c, test/ruby/enc/test_case_comprehensive.rb:duerst
Implement non-ASCII case conversion for ISO-8859-16, by Satoshi Kayama. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-03* test/ruby/enc/test_case_comprehensive.rb, test_regex_casefold.rb,duerst
test/test_unicode_normalize.rb: Replace UNICODE_VERSION from UnicodeNormalize with RbConfig::CONFIG['UNICODE_VERSION'] from feature 12460. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28Move CaseTestnobu
* test/ruby/enc/test_case_comprehensive.rb (CaseTest): move under the test case not to pollute the global name space. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-28Skip unavailable testsnobu
* test/ruby/enc/test_case_comprehensive.rb: noting to test if Unicode data files are available. [ruby-core:76160] [Bug #12433] * test/test_unicode_normalize.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-21It takes still too many memory...naruse
/usr/bin/time -l make RUBYOPT=-w TESTS='-v ruby/enc/test_case_comprehensive.rb' test-all ruby -v: ruby 2.4.0dev (2016-06-21 trunk 55473) [x86_64-freebsd10.3] 27.74 real 27.57 user 0.16 sys 115308 maximum resident set size 5 average shared memory size 4 average unshared data size 128 average unshared stack size 28443 page reclaims 0 page faults 0 swaps 2 block input operations 0 block output operations 0 messages sent 0 messages received 0 signals received 93 voluntary context switches 1123 involuntary context switches git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-20Optimize to speed upnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-20Don't cache simple data to reduce memory usagenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55474 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-14use \A and \z instead of ^ and $ in regexpkazu
* test/ruby/enc/test_case_comprehensive.rb (TestComprehensiveCaseFold::read_data): use \A and \z instead of ^ and $ in regexp. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-13* test/ruby/enc/test_case_comprehensive.rb: Add tests for full Unicodeduerst
swapcase. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-12* test/ruby/enc/test_case_comprehensive.rb: Add tests for ASCII-onlyduerst
swapcase; store calculated values in hashes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-11* enc/iso_8859_1.c: Implement non-ASCII case mapping.duerst
* test/ruby/enc/test_case_comprehensive.rb: Tests for above. * string.c: Add iso-8859-1 to supported encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07* test/ruby/enc/test_case_comprehensive: Change test for encodingsduerst
without any non-ASCII case conversions from ASCII-only test to full test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07* test/ruby/enc/test_case_comprehensive: Add regression tests forduerst
current ASCII-only case conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-07* test/ruby/enc/test_case_comprehensive: Fix method nameduerst
(generate_casefold_tests -> generate_case_mapping_tests). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-06* string.c: Added UTF-16BE/LE and UTF-32BE/LE to supported encodingsduerst
for Unicode case mapping. * test/ruby/enc/test_case_comprehensive.rb: Tests for above functionality; fixed an encoding issue in assertion error message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-06* test/ruby/enc/test_case_comprehensive.rb: Speed up testing for smallduerst
encodings by preselecting codepoints. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-06-05* test/ruby/enc/test_case_comprehensive.rb:duerst
Remove :lithuanian guard for Unicode case mapping. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-31Revert r55225naruse
Run test-all before large commit: "* string.c: Activate full Unicode case mapping for UTF-8 by removing" This reverts commit 3fb0fcd1e881c1f6dd74db73a64e8623208acb77. http://rubyci.s3.amazonaws.com/centos5-64/ruby-trunk/log/20160531T013303Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-31* string.c: Activate full Unicode case mapping for UTF-8 by removingduerst
the protective check for the presence of an option. Update documentation. * test/ruby/enc/test_case_comprehensive.rb: Adjust tests for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28* remove trailing spaces.svn
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e