is_binary "\x00 A", "\x00 B", 'binary data';
is_binary "\x00 A", [ qw( 00 20 42 ) ], 'binary data (ref)';
is_binary 'AA' x 512, 'AB' x 512, 'binary data (attr)', { columns => 79, max_diffs => 2, };
bits_is "\x01\x02", [ qw( 0b1 0b11 ) ], 'bits';
not ok 4 - bits # Failed test 'bits' # at ... # Binary data begins differing at byte 1. # Got: 00000010 # Expect: 00000011
is_hexstr "\x01ABC", "\x01ABCD", 'hex string';
eq_or_dump_diff "\x01ABC", "\x01ABCD", 'diff';
dumped_eq_dump_or_diff "\x01ABC", <<'EOT', 0000 : 01414243 : .ABC 0004 : 44 : D EOT 'diff dump';
eq_or_dump_diff "\x01\x23\x45\x67\x89\xAB\xCD\xEF" . "\x01\x23\x45\x67" . "\x89\xAB\xCD\xEF", "\x01\x23\x45\x67\x89\xAB\xCD\xEF" . "\x01\x23\x45\x67" . "\x89\xAB\xCD\xEF" . "\xFF", { address => 0x4000, format => <<"EOT", %a : %N %4C : %d\n%1x% %a : %n %2C : %d\n%*x EOT }, 'diff format';
"%a : %4C : %d\n"
oder komplett geschrieben
"%a : %4C : %d\n%*x"
Wenn die Daten länger als das Format sind, greift wieder das default Format.
%C - unsigned char %S - unsigned 16-bit, endian depends on machine %S< - unsigned 16-bit, little-endian %S> - unsigned 16-bit, big-endian %v - unsigned 16-bit, little-endian %n - unsigned 16-bit, big-endian %L - unsigned 32-bit, endian depends on machine %L< - unsigned 32-bit, little-endian %L> - unsigned 32-bit, big-endian %V - unsigned 32-bit, little-endian %N - unsigned 32-bit, big-endian %Q - unsigned 64-bit, endian depends on machine %Q< - unsigned 64-bit, little-endian %Q> - unsigned 64-bit, big-endian
%a - 16 bit address %4a - 16 bit address %8a - 32 bit address
%d - ASCII anzeigen, was nicht geht als .
%*x - endlos %1x - 1 Mal %2x - 2 Mal ...
%\n - ignore \n