-
-
04 Jul 2015 13:06:55 UTC
- Distribution: Test-HexDifferences
- Module version: 0.009
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues (0)
- Testers (290 / 0 / 0)
- Kwalitee
Bus factor: 1- 90.10% Coverage
- License: perl_5
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (11.55KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
and 1 contributors- Steffen Winkler <steffenw at cpan.org>
- Dependencies
- Hash::Util
- Sub::Exporter
- Test::Differences
- version
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- NAME
- VERSION
- SYNOPSIS
- EXAMPLE
- DESCRIPTION
- SUBROUTINES/METHODS
- DIAGNOSTICS
- CONFIGURATION AND ENVIRONMENT
- DEPENDENCIES
- INCOMPATIBILITIES
- BUGS AND LIMITATIONS
- SEE ALSO
- AUTHOR
- LICENSE AND COPYRIGHT
NAME
Test::HexDifferences - Test binary as hexadecimal string
VERSION
0.009
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
isundef
or a reference, the hexadecimal formatter is off. Theneq_or_dump_diff
is the same likeeq_or_diff
of Test::Differences.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.
The ascii format is not good for e.g. a length byte 0x41 displayed as A.
Multibyte values are better shown as 1 value.
Structured binary e.g. 2 byte length followed by bytes better are shown as it is.
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
INCOMPATIBILITIES
none
BUGS AND LIMITATIONS
none
SEE ALSO
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.
Module Install Instructions
To install Test::HexDifferences, copy and paste the appropriate command in to your terminal.
cpanm Test::HexDifferences
perl -MCPAN -e shell install Test::HexDifferences
For more information on module installation, please visit the detailed CPAN module installation guide.