File: 21_dirty_float.t

package info (click to toggle)
libdata-messagepack-perl 1.02-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,060 kB
  • sloc: ansic: 5,697; perl: 1,123; makefile: 10
file content (19 lines) | stat: -rw-r--r-- 369 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!perl
use strict;
use Config;
use if $Config{nvsize} > 8,
    'Test::More', skip_all => 'long double is not supported';
use Test::More;
use Data::MessagePack;

my $mp = Data::MessagePack->new();

foreach my $float(0.123, 3.14) {
    is $mp->unpack($mp->pack($float)), $float;

    scalar( $float > 0 );

    is $mp->unpack($mp->pack($float)), $float;
}
done_testing;