GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TEST::HEXDIFFERENCES (3)

.ds Aq ’

NAME

Test::HexDifferences - Test binary as hexadecimal string

CONTENTS

VERSION

1.000

SYNOPSIS



    use Test::HexDifferences;

    eq_or_dump_diff(
        $got,
        $expected,
    );

    eq_or_dump_diff(
        $got,
        $expected,
        $test_name,
    );

    eq_or_dump_diff(
        $got,
        $expected,
        {
            address => $start_address,
            format  => "%a : %4C : %d\n",
        }
        $test_name,
    );



If $got or $expected is undef or a reference, the hexadecimal formatter is off. Then eq_or_dump_diff is a text compare.



    dumped_eq_dump_or_diff(
        $got_value,
        $expected_dump,
    );

    dumped_eq_dump_or_diff(
        $got_value,
        $expected_dump,
        $test_name,
    );

    dumped_eq_dump_or_diff(
        $got_value,
        $expected_dump,
        {
            address => $start_address,
            format  => "%a : %4C : %d\n",
        }
        $test_name,
    );



See Test::HexDifferences::HexDump for the format description.

EXAMPLE

Inside of this Distribution is a directory named example. Run this *.t files.

DESCRIPTION

The are some special cases for testing binary data.
o The ascii format is not good for e.g. a length byte 0x41 displayed as A.
o Multibyte values are better shown as 1 value.
o Structured binary e.g. 2 byte length followed by bytes better are shown as it is.
o Compare 2 binary or 1 binary and a dump.

SUBROUTINES/METHODS

    subroutine eq_or_dump_diff



    eq_or_dump_diff(
        $got_value,
        $expected_value,
        {                                      # optional hash reference
            address => $display_start_address, # optional
            format  => $format_string,         # optional
        }
        $test_name,                            # optional
    );



    subroutine dumped_eq_dump_or_diff



    dumped_eq_dump_or_diff(
        $got_value,
        $expected_dump,
        {                                      # optional hash reference
            address => $display_start_address, # optional
            format  => $format_string,         # optional
        }
        $test_name,                            # optional
    );



DIAGNOSTICS

nothing

CONFIGURATION AND ENVIRONMENT

nothing

DEPENDENCIES

Sub::Exporter

Test::Builder::Module

Test::HexDifferences::HexDump

Text::Diff

INCOMPATIBILITIES

none

BUGS AND LIMITATIONS

none

SEE ALSO

Test::HexDifferences::HexDump

AUTHOR

Steffen Winkler

LICENSE AND COPYRIGHT

Copyright (c) 2012 - 2015, Steffen Winkler <steffenw at cpan.org>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 TEST::HEXDIFFERENCES (3) 2015-07-05

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.