File: endianspecifiers.t

package info (click to toggle)
libdata-hexdumper-perl 2.01-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 112 kB
  • ctags: 6
  • sloc: perl: 273; makefile: 2
file content (40 lines) | stat: -rwxr-xr-x 1,034 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!perl -w
# $Id: endianspecifiers.t,v 1.1 2009/03/03 20:18:06 drhyde Exp $

use strict;

use Test::More tests => 4;

use Data::Hexdumper qw(hexdump);

is_deeply(hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'n',
) , hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'S>',
), "n == S>");

is_deeply(hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'v',
) , hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'S<',
), "v == S<");

is_deeply(hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'N',
) , hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'L>',
), "N == L>");

is_deeply(hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'V',
) , hexdump(
    data => join('', map { pack('C', $_) } (0x20 .. 0x3F)),
    number_format => 'L<',
), "V == L<");