Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada 2bb217bfb7
Removed unused variables 2019-06-28 23:21:37 +09:00
duerst 7fe64d17d3 update to Unicode Version 12.1.0 (beta)
Unicode Version 12.1.0 adds one single character, U+32FF SQUARE ERA NAME REIWA,
for the new Japanese era starting on May 1st. 12.1.0 will be finalized only on
May 7th, so we go with the beta version because further changes in the data we
need are highly unlikely, and we want to make sure Ruby is ready for the new era.

* common.mk: change UNICODE_VERSION to 12.1.0, UNICODE_BETA to YES

* enc/unicode/12.1.0, enc/unicode/12.1.0/casefold.h, enc/unicode/12.1.0/name2ctype.h:
  add directory and generated data files for new version

* lib/unicode_normalize/tables.rb: update for new character

* test/ruby/test_regexp.rb: add test for character property age=12.1

* test/test_unicode_normalize.rb: add test for NFKC decomposition of new character

This (mostly) completes issue #15195.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-05 00:58:51 +00:00
duerst a7acec6750 fix range check for Hangul jamo trailers in Unicode normalization
* lib/unicode_normalize/normalize.rb: Fix the range check for trailing
  Hangul jamo characters in Unicode normalization. Different from
  leading or vowel jamos, where LBASE and VBASE are actual characters,
  a value equal to TBASE expresses the absence of a trailing jamo.
  This fix is technically correct, but there was no bug because
  the regular expressions in lib/unicode_normalize/tables.rb
  eliminate jamos equal to TBASE from normalization processing.

* test/test_unicode_normalize.rb: Add preventive test
  test_no_trailing_jamo based on
  d134809cd3
  just for the case we ever get a regression.

This closes issue #14934, thanks to MaLin (Lin Ma) for reporting.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 09:44:33 +00:00
duerst 9eb6304aa9 always run unicode normalization that do not depend on data file
* test/test_unicode_normalize.rb: extract tests that do not depend
  on NormalizationTest.txt data file from conditionally constructed
  part of TestUnicodeNormalize class, to always run them even if
  the data file isn't found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 09:11:13 +00:00
duerst fb1059312d update unicode data files directory for normalization tests
* test/test_unicode_normalize.rb: search ucd directory
  first if it exists. This change follows r61415.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-07-28 08:56:59 +00:00
duerst 4a41a0f7d6 * test/ruby/enc/test_case_comprehensive.rb, test_regex_casefold.rb,
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-07-03 09:51:46 +00:00
nobu 023aaa51a2 Skip unavailable tests
* 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-28 06:56:50 +00:00
duerst 3883bb6bae * test/test_unicode_normalize.rb: Add test to check for availability of
Unicode data file; refactoring; fix an error with tests for destructive
  method (unicode_normalize!).


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-28 11:34:20 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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
2015-12-16 05:07:31 +00:00
usa cda0d56296 * test/test_unicode_normalize.rb: get rid of a warning.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-14 00:59:23 +00:00
nobu 9efb9195e0 test_unicode_normalize.rb: skip only once
* test/test_unicode_normalize.rb (setup): skip only once, and
  silently ignore other tests.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-11 23:54:45 +00:00
nobu 16d2f2803f test_unicode_normalize.rb: skip if not found
* test/test_unicode_normalize.rb (read_tests): do nothing if the
  test data file is not found.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-11 23:06:53 +00:00
nobu 79c0b7fcc8 unicode_normalize: UNICODE_VERSION constant
* template/unicode_norm_gen.tmpl (UnicodeNormalize): embed the
  version of Unicode data files used to generate.

* test/test_unicode_normalize.rb (TestUnicodeNormalize): use the
  embedded version to load the test data.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 06:56:41 +00:00
akr 8f1b3a799f * test/test_unicode_normalize.rb: Rename TestNormalize to
TestUnicodeNormalize.
  Define constants under TestUnicodeNormalize.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-06 12:45:15 +00:00
hsbt f288185d46 * test/test_unicode_normalize.rb: added unicode version number to
test data location.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-31 00:59:25 +00:00
duerst 96d375540f test/test-unicode_normalize.rb: added test_us_ascii.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-25 11:19:22 +00:00
svn 6e9ff5a892 * remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-25 11:01:07 +00:00
duerst bdea9273ca test/test-unicode_normalize.rb: added test_raise_exception_for_non_unicode_encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-25 11:01:05 +00:00
duerst b3494924b6 test/test-unicode_normalize.rb: removed unused function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-25 10:30:36 +00:00
nobu d8918fa6b5 test_unicode_normalize.rb: show error messages
* test/test_unicode_normalize.rb (generate_test_normalize): defer
  building explicit error messages until assertion failed.  this
  is 3% slower than @@debug = false.

  (generate_test_check_true): ditto.
  (generate_test_check_false): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-23 12:36:25 +00:00
usa 86f5f02677 * test/test_unicode_normalize.rb: set encoding when reading.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 11:03:23 +00:00
nobu 8491998165 test/test_unicode_normalize.rb: don't set default encodings globally
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 10:55:13 +00:00
usa 6dd2a4810e * test/test-unicode_normalize.rb: as often said, ruby is sometimes built
at non-srcdir.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 09:14:24 +00:00
duerst 84f9fa8773 test/test-unicode_normalize.rb: Adjusted path for test data file (now ../enc/unicode/data/NormalizationTest.txt).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 09:12:14 +00:00
duerst 30b837b47c test/test-unicode_normalize.rb: Removed explicit require, changed method names, adjusted copyright.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 09:06:49 +00:00
duerst 15bfe2793a test/test-unicode_normalize.rb: Importing from
https://github.com/duerst/eprun/blob/master/test/test_normalize.rb.
(removing trailing whitespace, fixing EOLs and adding EOL property)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 09:00:04 +00:00