This project is archived and is in readonly mode.
[PATCH] multibyte_chars_test.rb failing tests
Reported by Santiago Pastorino | February 1st, 2010 @ 04:29 PM
Running ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux] on master
1) Failure:
test_center_should_count_charactes_instead_of_bytes(MultibyteCharsUTF8BehaviourTest)
[/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/test/multibyte_chars_test.rb:342:in `test_center_should_count_charactes_instead_of_bytes'
/home/santiago/.gem/ruby/1.9.1/gems/mocha-0.9.8/lib/mocha/integration/test_unit/gem_version_201_and_above.rb:20:in `run']:
<"ααこにちわαα"> expected but was
<"αこにちわα">.
diff:
- ααこにちわαα
? -- --
+ αこにちわα
2) Failure:
test_ljust_should_count_characters_instead_of_bytes(MultibyteCharsUTF8BehaviourTest)
[/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/test/multibyte_chars_test.rb:322:in `test_ljust_should_count_characters_instead_of_bytes'
/home/santiago/.gem/ruby/1.9.1/gems/mocha-0.9.8/lib/mocha/integration/test_unit/gem_version_201_and_above.rb:20:in `run']:
<"こにちわααα"> expected but was
<"こにちわαα">.
diff:
- こにちわααα
? --
+ こにちわαα
3) Failure:
test_rjust_should_count_characters_instead_of_bytes(MultibyteCharsUTF8BehaviourTest)
[/home/santiago/Documentos/WyeWorks/Proys/rails/activesupport/test/multibyte_chars_test.rb:304:in `test_rjust_should_count_characters_instead_of_bytes'
/home/santiago/.gem/ruby/1.9.1/gems/mocha-0.9.8/lib/mocha/integration/test_unit/gem_version_201_and_above.rb:20:in `run']:
<"αααこにちわ"> expected but was
<"ααこにちわ">.
diff:
- αααこにちわ
? --
+ ααこにちわ
Comments and changes to this ticket
-
Santiago Pastorino February 1st, 2010 @ 08:16 PM
- Assigned user set to Yehuda Katz (wycats)
Please close that is now commited
-
Prem Sichanugrist (sikachu) February 2nd, 2010 @ 08:12 AM
- State changed from new to resolved
Resolved by this commit
http://github.com/rails/rails/commit/bf1f70d8776e28f9181faefc491405...
-
Manfred Stienstra February 2nd, 2010 @ 08:24 AM
- State changed from resolved to open
Changing the examples made the tests run, but now they're not correct anymore. Consider the rjust failure and look at it with ASCII characters.
> '1111'.rjust(7, 'a') => "aaa1111"
In the test UNICODE_STRING is 4 characters long, so the following assertion is correct.
assert_equal "ααα#{UNICODE_STRING}", @chars.rjust(7, 'α')
-
Prem Sichanugrist (sikachu) February 2nd, 2010 @ 08:25 AM
So looks like it need to be revert? hmm ..
-
Manfred Stienstra February 2nd, 2010 @ 08:57 AM
Yes, please revert, this appears to be a bug in 1.9.1p376. Note that on 1.9 rjust, ljust, and center are directly forwarded to String.
The tests run fine on:
ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0] ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-darwin10.2.0] ruby 1.9.2dev (2010-02-02 trunk 26254) [x86_64-darwin10.2.0]
-
Manfred Stienstra February 2nd, 2010 @ 09:07 AM
I've also submitted a bug report to the Ruby tracker: http://redmine.ruby-lang.org/issues/show/2705. I would advise against using p376 right now if you're using rjust, ljust, or center in your code.
-
Santiago Pastorino February 2nd, 2010 @ 10:05 AM
Yes you're right Manfred, my bad :).
Here is the revert patch. -
Santiago Pastorino February 2nd, 2010 @ 11:06 AM
- Assigned user changed from Yehuda Katz (wycats) to José Valim
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Tags
Referenced by
- 3719 Errors in mutlibyte_chars_test for ActiveSupport Ruby 1.9.1 bug See that https://rails.lighthouseapp.com/...