Bug #12990
closedunicode_case_mapping_tests
Description
I found that tests generated by TestComprehensiveCaseFold.unicode_case_mapping_tests
compares target
with same target
, which should be always true usually.
I suspect this is unintentional, tried comparison target
with result
,
diff --git a/test/ruby/enc/test_case_comprehensive.rb b/test/ruby/enc/test_case_comprehensive.rb
index 13639f3..cfff9b8 100644
--- a/test/ruby/enc/test_case_comprehensive.rb
+++ b/test/ruby/enc/test_case_comprehensive.rb
@@ -149,7 +149,7 @@
source = code.encode(encoding) * 5
target = "#{test.first_data[code]}#{test.follow_data[code]*4}".encode(encoding)
result = source.__send__(test.method_name, *test.attributes)
- assert_equal target, target,
+ assert_equal target, result,
proc{"from #{code*5} (#{source.dump}) expected #{target.dump} but was #{result.dump}"}
end
end
and got 30 failures.
Is this intentional?
Updated by nobu (Nobuyoshi Nakada) about 8 years ago
Failed results:
$ ./ruby test/runner.rb test/ruby/enc/test_case_comprehensive.rb
Run options:
# Running tests:
[258/422] TestComprehensiveCaseFold#test_UTF-16BE_capitalize = 0.30 s
1) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_capitalize [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[260/422] TestComprehensiveCaseFold#test_UTF-16BE_capitalize_turkic = 0.32 s
2) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_capitalize_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[265/422] TestComprehensiveCaseFold#test_UTF-16BE_swapcase = 0.28 s
3) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_swapcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6J\xA6J\xA6J\xA6J".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[267/422] TestComprehensiveCaseFold#test_UTF-16BE_swapcase_turkic = 0.31 s
4) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_swapcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6J\xA6J\xA6J\xA6J".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[268/422] TestComprehensiveCaseFold#test_UTF-16BE_upcase = 0.30 s
5) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_upcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6J\xA6J\xA6J\xA6J".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[270/422] TestComprehensiveCaseFold#test_UTF-16BE_upcase_turkic = 0.31 s
6) Failure:
TestComprehensiveCaseFold#test_UTF-16BE_upcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE")) expected "\xA6J\xA6J\xA6J\xA6J\xA6J".force_encoding("UTF-16BE") but was "\xA6K\xA6K\xA6K\xA6K\xA6K".force_encoding("UTF-16BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[271/422] TestComprehensiveCaseFold#test_UTF-16LE_capitalize = 0.30 s
7) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_capitalize [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[273/422] TestComprehensiveCaseFold#test_UTF-16LE_capitalize_turkic = 0.31 s
8) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_capitalize_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[278/422] TestComprehensiveCaseFold#test_UTF-16LE_swapcase = 0.25 s
9) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_swapcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6J\xA6J\xA6J\xA6J\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[280/422] TestComprehensiveCaseFold#test_UTF-16LE_swapcase_turkic = 0.32 s
10) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_swapcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6J\xA6J\xA6J\xA6J\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[281/422] TestComprehensiveCaseFold#test_UTF-16LE_upcase = 0.30 s
11) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_upcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6J\xA6J\xA6J\xA6J\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[283/422] TestComprehensiveCaseFold#test_UTF-16LE_upcase_turkic = 0.29 s
12) Failure:
TestComprehensiveCaseFold#test_UTF-16LE_upcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE")) expected "J\xA6J\xA6J\xA6J\xA6J\xA6".force_encoding("UTF-16LE") but was "K\xA6K\xA6K\xA6K\xA6K\xA6".force_encoding("UTF-16LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[284/422] TestComprehensiveCaseFold#test_UTF-32BE_capitalize = 0.31 s
13) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_capitalize [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[286/422] TestComprehensiveCaseFold#test_UTF-32BE_capitalize_turkic = 0.32 s
14) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_capitalize_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[291/422] TestComprehensiveCaseFold#test_UTF-32BE_swapcase = 0.28 s
15) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_swapcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[293/422] TestComprehensiveCaseFold#test_UTF-32BE_swapcase_turkic = 0.31 s
16) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_swapcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[294/422] TestComprehensiveCaseFold#test_UTF-32BE_upcase = 0.32 s
17) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_upcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[296/422] TestComprehensiveCaseFold#test_UTF-32BE_upcase_turkic = 0.31 s
18) Failure:
TestComprehensiveCaseFold#test_UTF-32BE_upcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE")) expected "\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J\x00\x00\xA6J".force_encoding("UTF-32BE") but was "\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K\x00\x00\xA6K".force_encoding("UTF-32BE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[297/422] TestComprehensiveCaseFold#test_UTF-32LE_capitalize = 0.31 s
19) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_capitalize [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[299/422] TestComprehensiveCaseFold#test_UTF-32LE_capitalize_turkic = 0.32 s
20) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_capitalize_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64B\uA64B\uA64B\uA64B"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[304/422] TestComprehensiveCaseFold#test_UTF-32LE_swapcase = 0.30 s
21) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_swapcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[306/422] TestComprehensiveCaseFold#test_UTF-32LE_swapcase_turkic = 0.30 s
22) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_swapcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[307/422] TestComprehensiveCaseFold#test_UTF-32LE_upcase = 0.33 s
23) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_upcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[309/422] TestComprehensiveCaseFold#test_UTF-32LE_upcase_turkic = 0.31 s
24) Failure:
TestComprehensiveCaseFold#test_UTF-32LE_upcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE")) expected "J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00J\xA6\x00\x00".force_encoding("UTF-32LE") but was "K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00K\xA6\x00\x00".force_encoding("UTF-32LE").
<"\uA64A\uA64A\uA64A\uA64A\uA64A"> expected but was
<"\uA64B\uA64B\uA64B\uA64B\uA64B">.
[310/422] TestComprehensiveCaseFold#test_UTF-8_capitalize = 0.21 s
25) Failure:
TestComprehensiveCaseFold#test_UTF-8_capitalize [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64B\uA64B\uA64B\uA64B" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"Ꙋꙋꙋꙋꙋ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
[312/422] TestComprehensiveCaseFold#test_UTF-8_capitalize_turkic = 0.20 s
26) Failure:
TestComprehensiveCaseFold#test_UTF-8_capitalize_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64B\uA64B\uA64B\uA64B" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"Ꙋꙋꙋꙋꙋ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
[317/422] TestComprehensiveCaseFold#test_UTF-8_swapcase = 0.17 s
27) Failure:
TestComprehensiveCaseFold#test_UTF-8_swapcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64A\uA64A\uA64A\uA64A" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"ꙊꙊꙊꙊꙊ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
[319/422] TestComprehensiveCaseFold#test_UTF-8_swapcase_turkic = 0.19 s
28) Failure:
TestComprehensiveCaseFold#test_UTF-8_swapcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64A\uA64A\uA64A\uA64A" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"ꙊꙊꙊꙊꙊ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
[320/422] TestComprehensiveCaseFold#test_UTF-8_upcase = 0.20 s
29) Failure:
TestComprehensiveCaseFold#test_UTF-8_upcase [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64A\uA64A\uA64A\uA64A" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"ꙊꙊꙊꙊꙊ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
[322/422] TestComprehensiveCaseFold#test_UTF-8_upcase_turkic = 0.20 s
30) Failure:
TestComprehensiveCaseFold#test_UTF-8_upcase_turkic [/test/ruby/enc/test_case_comprehensive.rb:152]:
from ꙋꙋꙋꙋꙋ ("\uA64B\uA64B\uA64B\uA64B\uA64B") expected "\uA64A\uA64A\uA64A\uA64A\uA64A" but was "\uA64B\uA64B\uA64B\uA64B\uA64B".
<"ꙊꙊꙊꙊꙊ"> expected but was
<"ꙋꙋꙋꙋꙋ">.
Finished tests in 35.554346s, 11.8692 tests/s, 47956.5002 assertions/s.
422 tests, 1705062 assertions, 30 failures, 0 errors, 0 skips
ruby -v: ruby 2.4.0dev (2016-11-27 trunk 56907) [x86_64-darwin15]
Updated by duerst (Martin Dürst) about 8 years ago
- Status changed from Assigned to Closed
Applied in changeset r56924.
Fix erroneous test of target against target
- 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)
Updated by duerst (Martin Dürst) about 8 years ago
- Status changed from Closed to Open
Nobuyoshi Nakada wrote:
I found that tests generated by
TestComprehensiveCaseFold.unicode_case_mapping_tests
comparestarget
with sametarget
, which should be always true usually.
Nice catch, thanks! This is indeed a serious error. I fixed it.
I suspect this is unintentional, tried comparison
target
withresult
,
and got 30 failures.
I confirmed this. The failures are all related to one very rare character, U+A64B CYRILLIC SMALL LETTER MONOGRAPH UK. I have temporarily excluded this character from the tests. All tests pass for all other characters.
Is this intentional?
No. The upper case equivalent of U+A64B should clearly be U+A64A CYRILLIC CAPITAL LETTER MONOGRAPH UK, but somehow it seems the data doesn't reflect this, and says it's U+A64B. This produces 30 failures because of all the combinations of encodings, methods, and options.
I have some hunch about the reason for the error. It may be related to the fact that there is a third character, U+1C88 CYRILLIC SMALL LETTER UNBLENDED UK, which also has U+A64A as an upper-case equivalent. U+1C88 was newly added in Unicode 9.0, see http://www.unicode.org/versions/Unicode9.0.0/ (search for "Casing-related Issues"). There are several similar cases, but there may be an ordering issue (the 'special' U+1C88 comes before the 'regular' U+A64B, whereas it's the other way round for all the other, similar cases). I suspected there would be an ordering issues, but was assuming that the tests had me covered :-(. I'll investigate further to check whether my hunch is right or not.
Updated by duerst (Martin Dürst) about 8 years ago
The culprit is line 4555 in enc/unicode/9.0.0/casefold.h:
{0xa64b, {2, {0x1c88, 0xa64a}}},
With comments, this looks as follows:
{0xa64b /* ꙋ */, {2, {0x1c88, 0xa64a /* ᲈ, Ꙋ */}}},
Correct would be
{0xa64b, {1|U, {0xa64a}}},
But I don't want to fix this directly in enc/unicode/9.0.0/casefold.h because this file autogenerated.
Updated by duerst (Martin Dürst) about 8 years ago
Just for the record, I think this is where the problem was introduced:
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/55478/diff/test/ruby/enc/test_case_comprehensive.rb
That explains why almost all characters are okay (only changes from Unicode 8.0.0 to Unicode 9.0.0 happened after this test bug).
Updated by duerst (Martin Dürst) about 8 years ago
- Status changed from Open to Closed
Applied in changeset r56941.
fix uppercasing for U+A64B, CYRILLIC SMALL LETTER MONOGRAPH UK
-
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.
Updated by duerst (Martin Dürst) about 8 years ago
A short additional note: If cases like these increase with future versions of Unicode, I plan to change the special treatment of U+03B9/U+03BC/U+A64B to something more data-based.
Updated by duerst (Martin Dürst) about 8 years ago
Martin Dürst wrote:
A short additional note: If cases like these increase with future versions of Unicode, I plan to change the special treatment of U+03B9/U+03BC/U+A64B to something more data-based.
I have just done that with r56968 / r56975 / r56976.