Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

This is not a public project

This project is archived and is in readonly mode.

[PATCH] multibyte_chars_test.rb failing tests

#3835

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:
- αααこにちわ
? --
+ ααこにちわ

Reported by Santiago Pastorino · February 1st, 2010 @ 04:29 PM

State: wontfix
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Santiago Pastorino
    Santiago Pastorino
    • Assigned user set to Yehuda Katz (wycats)

    Please close that is now commited

    February 1st, 2010 @ 08:16 PM

  2. Prem Sichanugrist (sikachu)
  3. Manfred Stienstra
    Manfred Stienstra
    • 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, 'α')
    

    February 2nd, 2010 @ 08:24 AM

  4. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)

    So looks like it need to be revert? hmm ..

    February 2nd, 2010 @ 08:25 AM

  5. Manfred Stienstra
    Manfred Stienstra

    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]
    

    February 2nd, 2010 @ 08:57 AM

  6. Manfred Stienstra
    Manfred Stienstra

    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.

    February 2nd, 2010 @ 09:07 AM

  7. Santiago Pastorino
    Santiago Pastorino

    Yes you're right Manfred, my bad :).
    Here is the revert patch.

    February 2nd, 2010 @ 10:05 AM

  8. Santiago Pastorino
    Santiago Pastorino
    • Assigned user changed from Yehuda Katz (wycats) to José Valim

    February 2nd, 2010 @ 11:06 AM

  9. José Valim
    José Valim
    • State changed from open to wontfix

    Reverted.

    February 2nd, 2010 @ 11:09 AM