Issues

ZF-2169: testToFloatSetlocale(Zend_Locale_FormatTest) unit tests fails

Issue Type: Unit Tests: Problem Created: 2007-11-08T10:53:23.000+0000 Last Updated: 2008-02-26T12:56:08.000+0000 Status: Resolved Fix version(s): - 1.0.4 (26/Feb/08)

Reporter: Alexander Veremyev (alexander) Assignee: Thomas Weidner (thomas) Tags: - Zend_Locale

Related issues: - ZF-2272

Attachments: - Format.php

Description

Error message:

<pre class="highlight">
4) testToFloatSetlocale(Zend_Locale_FormatTest)
Failed asserting that two strings are equal.
expected string <1 234,00>
difference      <       x>
got string      <1 234,50>
/usr/local/Zend/ZendFramework/tests/Zend/Locale/FormatTest.php:904
/usr/local/Zend/ZendFramework/tests/AllTests.php:45
/usr/local/Zend/ZendFramework/tests/AllTests.php:61

Comments

Posted by Thomas Weidner (thomas) on 2007-11-27T01:23:08.000+0000

Alex, can you please test with the latest revision from trunk ? And change your local "Format.php" within "Zend/Locale/" directory with the here attached one ?

Please return me the debug output for both tests.

THANKS

Posted by Thomas Weidner (thomas) on 2007-11-27T01:24:14.000+0000

Debug Version

Posted by Thomas Weidner (thomas) on 2007-12-15T16:17:09.000+0000

Without the output of the attached debug version I will not be able to fix this error... If there is no response anymore I will close this one as it seems that it is then already fixed.

Posted by Thomas Weidner (thomas) on 2007-12-29T11:27:33.000+0000

As I am not getting response since 27.November my own tests did not show this error I expect that it does no longer exist.

If it does, please reopen and give detail report of the attached debug version.

Posted by Darby Felton (darby) on 2008-01-02T09:07:56.000+0000

After adding a line to Zend/Locale/FormatTest.php that includes the TestHelper.php script for include_path specification:

<pre class="literal">
phpunit --verbose Zend_Locale_FormatTest > Zend_Locale_FormatTest.out 2>&1

produced the output:

<pre class="literal">
PHPUnit 3.2.8 by Sebastian Bergmann.

Zend_Locale_FormatTest
.
toNumber
--------
Value :'0'
Locale:''
Renew
Format:'#,##0.###'
Value :'0'
Prec  :''E..
toNumber
--------
Value :'0'
Locale:''
Pattern
Norm  :'0'
Format:'#,##0.###'
Value :'0'
Prec  :''E..
toNumber
--------
Value :'0'
Locale:''
Pattern
Set Pr:'0'
Norm  :'0'
Format:'#,##0.###'
Value :'0'
Prec  :'0'E......
toNumber
--------
Value :'0'
Locale:''
Renew
Format:'#,##0.###'
Value :'0'
Prec  :''E
toNumber
--------
Value :'1.7'
Locale:'en'
Renew
Format:'#,##0.###'
Value :'1.7'
Prec  :''
Precst:'7'
Int   :'1'
Prec1 :'0.7'
Prec2 :'0.7'
Prec3 :'0.7'
Prec4 :'0.7'
Rest  :''
Format:'#,##.7'
Form2 :'1.7'
Form3 :'1.7'
toNumber
--------
Value :'2.3'
Locale:'en'
Renew
Format:'#,##0.###'
Value :'2.3'
Prec  :''
Precst:'3'
Int   :'2'
Prec1 :'0.3'
Prec2 :'0.3'
Prec3 :'0.3'
Prec4 :'0.3'
Rest  :''
Format:'#,##.3'
Form2 :'2.3'
Form3 :'2.3'...
toNumber
--------
Value :'1234.5'
Locale:'fr_FR'
Pattern
Set Pr:'1234.5'
Norm  :'1234.5'
Format:'#,##0.###'
Value :'1234.5'
Prec  :'2'
Precst:'50'
Int   :'1234'
Prec1 :'0.50'
Prec2 :'0.50'
Prec3 :'0.50'
Prec4 :'0.50'
Rest  :''
Format:'#,##,50'
Form2 :'1Â 234,50'
Form3 :'1Â 234,50'
toNumber
--------
Value :'1234.5'
Locale:'en_US'
Pattern
Set Pr:'1234.5'
Norm  :'1234.5'
Format:'#,##0.###'
Value :'1234.5'
Prec  :'2'
Precst:'50'
Int   :'1234'
Prec1 :'0.50'
Prec2 :'0.50'
Prec3 :'0.50'
Prec4 :'0.50'
Rest  :''
Format:'#,##.50'
Form2 :'1,234.50'
Form3 :'1,234.50'.


Time: 2 seconds

There were 4 errors:

1) testToNumber(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:101

2) testToFloat(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/library/Zend/Locale/Format.php:547
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:187

3) testtoInteger(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/library/Zend/Locale/Format.php:599
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:265

4) testToNumberFormat(Zend_Locale_FormatTest)
Undefined variable: precstr
/home/darby/framework/trunk/library/Zend/Locale/Format.php:397
/home/darby/framework/trunk/tests/Zend/Locale/FormatTest.php:691

FAILURES!
Tests: 19, Errors: 4.

Posted by Darby Felton (darby) on 2008-01-02T09:08:38.000+0000

Reopening issue with output from tests

Posted by Thomas Weidner (thomas) on 2008-01-07T14:48:50.000+0000

Debug Version for the new release

Posted by Darby Felton (darby) on 2008-01-07T14:57:19.000+0000

testing comments....

Posted by Thomas Weidner (thomas) on 2008-01-07T15:00:10.000+0000

Darby,

I don't know why now all comments are gone so I try to answer your comment from my memory:

Within my testbed I don't have to add an include... I can run phpunit Zend_Locale_FormatTest instantly. I was also not able to verify the behaviour that the output of "precstr" breaks the test.

Because the I18N core has been rewritten, I had also to change the debug version. The above mentioned problem does now no longer occur.

But the generated output is "VERY" complete. It would be best if you add the debug output as attachment so I can read through it. This new version must be tested with the latest SVN.

Thank you for your help on this one...

Posted by Wil Sinclair (wil) on 2008-01-07T15:08:00.000+0000

Comments should be OK now.

Posted by Thomas Weidner (thomas) on 2008-01-07T15:16:19.000+0000

Thanks Wil

Posted by Darby Felton (darby) on 2008-01-07T15:35:36.000+0000

I can no longer reproduce the error messages, so it looks like this is fixed for me, too. Attaching latest output just in case it's useful. Thanks, Thomas! :)

Posted by Thomas Weidner (thomas) on 2008-01-07T16:00:33.000+0000

I looked through the output and saw no problems. Eighter the changed default behaviour or the new LDML implementation has done it.

Anyhow, because it is fixed with the actual release, I will close this issue.

Posted by Thomas Weidner (thomas) on 2008-01-07T16:01:38.000+0000

Fixed with SVN-7357

Posted by Darby Felton (darby) on 2008-01-08T16:12:09.000+0000

Relates to [ZF-2272]

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts