File: hex.t

package info (click to toggle)
libxml-smart-perl 1.78-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 784 kB
  • sloc: perl: 3,644; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 962 bytes parent folder | download | duplicates (3)
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
#!perl -T
use 5.006                   ;
use strict                  ;
use warnings FATAL => 'all' ;
use Test::More              ;

use XML::Smart              ;  


subtest 'Raw Binary Data' => sub {

    my $bin_data_string = '' ;
    my @bin_data = split( //, $bin_data_string ) ;
    foreach my $bin_elem ( @bin_data ) { 
	cmp_ok( XML::Smart::_data_type( $bin_elem ), '==', 4, 'RawBinData: ' . "0x" . unpack("H*", $bin_elem ) );
    }

    done_testing() ;
};

subtest 'Raw Binary Data Unimplemented' => sub { 

    
    my @bin_data = (     
	0x80, 0x81, 0x8d, 0x8f, 0x90, 0xa0 
	);
    
    foreach my $bin_elem ( @bin_data ) { 
	my $bin_elem_converted = pack("H*", $bin_elem );
	cmp_ok( XML::Smart::_data_type( $bin_elem ), '==', 1, 'RawBinData Unimplemented: ' . "0x" . $bin_elem );
    }

    done_testing() ;

};

done_testing() ;