Actions
Patch #28112
closedCsvTest fails due to a regression in Ruby 2.5
Start date:
Due date:
% Done:
0%
Estimated time:
Description
Ruby 2.5.0 at r17185 don't pass csv_test.rb:29.
Failure: CsvTest#test_should_include_bom_when_utf8_encoded [/Users/sho-h/local/src/redmine/redmine.sho-h/test/unit/lib/redmine/export/csv_test.rb:29]: Expected false to be truthy.
Maybe, the reason is regression in 2.5.0.
$ cat csvtest.rb require 'csv' bom = "\xEF\xBB\xBF" res1_1 = bom.dup res1_2 = CSV.generate(res1_1, encoding: "UTF-8") {|csv| csv << %w(Foo Bar)} p [bom, res1_1, res1_2] res2_1 = "aa,bb" res2_2 = CSV.generate(res2_1, encoding: "UTF-8") {|csv| csv << %w(Foo Bar)} p [bom, res2_1, res2_2] $ rbenv each ruby -v csvtest.rb | more ... ruby 2.3.6p384 (2017-12-14 revision 61254) [x86_64-darwin15] ["<U+FEFF>", "<U+FEFF>Foo,Bar\n", "<U+FEFF>Foo,Bar\n"] ["<U+FEFF>", "aa,bbFoo,Bar\n", "aa,bbFoo,Bar\n"] ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin15] ["<U+FEFF>", "<U+FEFF>Foo,Bar\n", "<U+FEFF>Foo,Bar\n"] ["<U+FEFF>", "aa,bbFoo,Bar\n", "aa,bbFoo,Bar\n"] ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin15] ["<U+FEFF>", "Foo,Bar\n", "Foo,Bar\n"] ["<U+FEFF>", "Foo,Bar\n", "Foo,Bar\n"]
This problem was already reported below.
I attach patch to fix this problem. This patch don't use CSV.generate's first argument.
Files
Related issues
Actions