Bugzilla – Attachment 52505 Details for
Bug 16768
Add official number format for Switzerland: 1'234'567.89
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16768: Add tests for Swiss number format
Bug-16768-Add-tests-for-Swiss-number-format.patch (text/plain), 2.06 KB, created by
Marc Véron
on 2016-06-18 08:33:32 UTC
(
hide
)
Description:
Bug 16768: Add tests for Swiss number format
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2016-06-18 08:33:32 UTC
Size:
2.06 KB
patch
obsolete
>From c0731315188d69d6876c6d9536ab5ee939ec0e75 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sat, 18 Jun 2016 09:16:58 +0200 >Subject: [PATCH] Bug 16768: Add tests for Swiss number format > >Testplan: >- Apply patch >- Run t/Number/Price.t >--- > t/Number/Price.t | 33 ++++++++++++++++++++++++++++++++- > 1 file changed, 32 insertions(+), 1 deletion(-) > >diff --git a/t/Number/Price.t b/t/Number/Price.t >index 060b183..ad4f0cf 100644 >--- a/t/Number/Price.t >+++ b/t/Number/Price.t >@@ -1,6 +1,6 @@ > use Modern::Perl; > >-use Test::More tests => 19; >+use Test::More tests => 28; > > use Test::MockModule; > use t::lib::Mocks; >@@ -75,3 +75,34 @@ is( Koha::Number::Price->new->unformat, '0', 'FR: unformat 0' ); > is( Koha::Number::Price->new(3)->unformat, '3', 'FR: unformat 3' ); > is( Koha::Number::Price->new(1234567890)->unformat, > '1234567890', 'FR: unformat 1234567890' ); >+ >+# Price formatting for Switzerland: 1'234'567.89 >+t::lib::Mocks::mock_preference( 'CurrencyFormat', 'CH' ); >+$currency = Koha::Acquisition::Currency->new({ >+ currency => 'nnn', >+ symbol => 'CHF', >+ rate => 1, >+ active => 1, >+}); >+ >+is( Koha::Number::Price->new->format( $format ), '0.00', 'CH: format 0' ); >+is( Koha::Number::Price->new(3)->format( $format ), '3.00', 'CH: format 3' ); >+is( >+ Koha::Number::Price->new(1234567890)->format( $format ), >+ '1\'234\'567\'890.00', >+ 'CHF: format 1234567890' >+); >+is( Koha::Number::Price->new->format( { %$format, with_symbol => 1 } ), >+ 'CHF0.00', 'CH: format 0 with symbol' ); >+is( Koha::Number::Price->new(3)->format( { %$format, with_symbol => 1 } ), >+ 'CHF3.00', 'CH: format 3 with symbol' ); >+is( >+ Koha::Number::Price->new(1234567890) >+ ->format( { %$format, with_symbol => 1 }, 'CH: format 123567890 with symbol' ), >+ 'CHF1\'234\'567\'890.00' >+); >+ >+is( Koha::Number::Price->new->unformat, '0', 'CHF: unformat 0' ); >+is( Koha::Number::Price->new(3)->unformat, '3', 'CHF: unformat 3' ); >+is( Koha::Number::Price->new(1234567890)->unformat, >+ '1234567890', 'CHF: unformat 1234567890' ); >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16768
:
52504
|
52505
|
52506
|
52507
|
52519
|
52521
|
52523
|
52524
|
52527
|
52528
|
52529
|
52530
|
52531