From 79c0b7fcc86f5283ba3de22720eebf554b8e267c Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 10 Nov 2014 06:56:41 +0000 Subject: 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 --- test/test_unicode_normalize.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/test_unicode_normalize.rb') diff --git a/test/test_unicode_normalize.rb b/test/test_unicode_normalize.rb index 64916a0855..75b571a4a3 100644 --- a/test/test_unicode_normalize.rb +++ b/test/test_unicode_normalize.rb @@ -3,15 +3,17 @@ # Copyright Ayumu Nojima (野島 歩) and Martin J. Dürst (duerst@it.aoyama.ac.jp) require 'test/unit' +require 'unicode_normalize/normalize' class TestUnicodeNormalize < Test::Unit::TestCase - UNICODE_VERSION = '7.0.0' + UNICODE_VERSION = UnicodeNormalize::UNICODE_VERSION NormTest = Struct.new :source, :NFC, :NFD, :NFKC, :NFKD, :line def read_tests IO.readlines(File.expand_path("../enc/unicode/data/#{UNICODE_VERSION}/NormalizationTest.txt", __dir__), encoding: 'utf-8') + .tap { |lines| assert_include(lines[0], "NormalizationTest-#{UNICODE_VERSION}.txt")} .collect.with_index { |linedata, linenumber| [linedata, linenumber]} .reject { |line| line[0] =~ /^[\#@]/ } .collect do |line| -- cgit v1.2.3