diff -Nru libpgobject-type-bigfloat-perl-2/Changes libpgobject-type-bigfloat-perl-2.001/Changes --- libpgobject-type-bigfloat-perl-2/Changes 2017-05-09 21:59:56.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/Changes 2018-06-06 06:47:52.000000000 +0000 @@ -1,5 +1,9 @@ Revision history for PGObject-Type-BigFloat +2.1.0 2018-06-04 + Add accuracy, precision, round_mode, div_scale globals, + so they have defaults and can be set properly. + 2.0.0 TBD PGObject 2.x support Registry may throw errors if type has been defined before. diff -Nru libpgobject-type-bigfloat-perl-2/debian/changelog libpgobject-type-bigfloat-perl-2.001/debian/changelog --- libpgobject-type-bigfloat-perl-2/debian/changelog 2017-07-07 14:47:07.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/debian/changelog 2018-06-06 13:02:41.000000000 +0000 @@ -1,3 +1,14 @@ +libpgobject-type-bigfloat-perl (2.001-1) unstable; urgency=medium + + [ Salvatore Bonaccorso ] + * Update Vcs-* headers for switch to salsa.debian.org + + [ Robert James Clay ] + * Import upstream version 2.001 + * Declare conformance with Policy 4.1.4 (no changes needed) + + -- Robert James Clay Wed, 06 Jun 2018 09:02:41 -0400 + libpgobject-type-bigfloat-perl (2-1) unstable; urgency=medium [ Salvatore Bonaccorso ] diff -Nru libpgobject-type-bigfloat-perl-2/debian/control libpgobject-type-bigfloat-perl-2.001/debian/control --- libpgobject-type-bigfloat-perl-2/debian/control 2017-07-07 14:47:07.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/debian/control 2018-06-06 13:02:41.000000000 +0000 @@ -10,9 +10,9 @@ libtest-exception-perl, libtest-pod-perl, libtest-pod-coverage-perl -Standards-Version: 4.0.0 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-perl/packages/libpgobject-type-bigfloat-perl.git -Vcs-Git: https://anonscm.debian.org/git/pkg-perl/packages/libpgobject-type-bigfloat-perl.git +Standards-Version: 4.1.4 +Vcs-Browser: https://salsa.debian.org/perl-team/modules/packages/libpgobject-type-bigfloat-perl +Vcs-Git: https://salsa.debian.org/perl-team/modules/packages/libpgobject-type-bigfloat-perl.git Homepage: https://metacpan.org/release/PGObject-Type-BigFloat Testsuite: autopkgtest-pkg-perl diff -Nru libpgobject-type-bigfloat-perl-2/lib/PGObject/Type/BigFloat.pm libpgobject-type-bigfloat-perl-2.001/lib/PGObject/Type/BigFloat.pm --- libpgobject-type-bigfloat-perl-2/lib/PGObject/Type/BigFloat.pm 2017-05-09 23:53:07.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/lib/PGObject/Type/BigFloat.pm 2018-06-06 06:47:52.000000000 +0000 @@ -13,12 +13,18 @@ =head1 VERSION -Version 2 +Version 2.001 =cut -our $VERSION = 2.000000; +our $VERSION = 2.001000; +our ($accuracy, $precision, $round_mode, $div_scale); + +# Globals +$accuracy = $precision = undef; +$round_mode = 'even'; +$div_scale = 40; =head1 SYNOPSIS diff -Nru libpgobject-type-bigfloat-perl-2/META.json libpgobject-type-bigfloat-perl-2.001/META.json --- libpgobject-type-bigfloat-perl-2/META.json 2017-05-20 15:28:29.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/META.json 2018-06-06 06:48:08.000000000 +0000 @@ -4,7 +4,7 @@ "Chris Travers " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005", + "generated_by" : "ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001", "license" : [ "bsd" ], @@ -45,6 +45,5 @@ "web" : "https://github.com/ledgersmb/PGObject-Type-BigFloat" } }, - "version" : 2, - "x_serialization_backend" : "JSON::PP version 2.27400" + "version" : 2.001 } diff -Nru libpgobject-type-bigfloat-perl-2/META.yml libpgobject-type-bigfloat-perl-2.001/META.yml --- libpgobject-type-bigfloat-perl-2/META.yml 2017-05-20 15:28:29.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/META.yml 2018-06-06 06:48:08.000000000 +0000 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150005' +generated_by: 'ExtUtils::MakeMaker version 7.0401, CPAN::Meta::Converter version 2.150001' license: bsd meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -22,5 +22,4 @@ PGObject: '0' resources: repository: https://github.com/ledgersmb/PGObject-Type-BigFloat.git -version: 2 -x_serialization_backend: 'CPAN::Meta::YAML version 0.018' +version: 2.001 diff -Nru libpgobject-type-bigfloat-perl-2/t/02-dbinterface.t libpgobject-type-bigfloat-perl-2.001/t/02-dbinterface.t --- libpgobject-type-bigfloat-perl-2/t/02-dbinterface.t 2017-05-09 23:45:09.000000000 +0000 +++ libpgobject-type-bigfloat-perl-2.001/t/02-dbinterface.t 2018-06-06 06:47:52.000000000 +0000 @@ -1,4 +1,4 @@ -use Test::More tests => 39; +use Test::More tests => 47; use PGObject::Type::BigFloat; my @values = (1.234, 1000, 1234.34, -12333.23, 12143234523, 4233143455, @@ -15,3 +15,21 @@ is(ref $out, '', "Output is not an object"); is($out, $val, "Value matches on output"); } + +is(PGObject::Type::BigFloat->div_scale,40,"div_scale initialized"); +is(PGObject::Type::BigFloat->accuracy,undef,"accuracy initialized"); +is(PGObject::Type::BigFloat->precision,undef,"precision initialized"); +is(PGObject::Type::BigFloat->round_mode,'even',"round_mode initialized"); + +PGObject::Type::BigFloat->accuracy(2); +is(PGObject::Type::BigFloat->accuracy,2,"accuracy initialized"); + +my $testvar = PGObject::Type::BigFloat->from_db(1.234/2); + +is($testvar->to_db, 0.62, "Value matches proper accuracy"); + +PGObject::Type::BigFloat->precision(-2); +is(PGObject::Type::BigFloat->precision,-2,"precision initialized"); + +$testvar = PGObject::Type::BigFloat->from_db(1.234/2); +is($testvar->to_db, 0.62, "Value matches proper precision");