2
2
3
3
# # test the construction of the Moose attribute structure in Xray::XDI;
4
4
5
- use Test::More tests => 45 ;
5
+ use Test::More tests => 46 ;
6
6
7
7
use strict;
8
8
use warnings;
@@ -16,23 +16,24 @@ BEGIN { use_ok('Xray::XDI') };
16
16
my $here = dirname($0 );
17
17
my $file = File::Spec-> catfile($here , ' ..' , ' ..' , ' data' , ' co_metal_rt.xdi' );
18
18
my $xdi = Xray::XDI-> new(file => $file );
19
- ok($xdi =~ m { Xray::XDI} , ' created Xray::XDI object' );
20
- ok($xdi -> ok, ' ok flag is true' );
21
- ok($xdi -> error eq ' ' , ' error text is empty' );
22
-
23
- ok( $xdi -> token(' comment' ) eq ' #' , ' token: comment' );
24
- ok( $xdi -> token(' delimiter' ) eq ' :' , ' token: delimiter' );
25
- ok( $xdi -> token(' dot' ) eq ' .' , ' token: dot' );
26
- ok( $xdi -> token(' startcomment' ) eq ' ///' , ' token: startcomment' );
27
- ok( $xdi -> token(' endcomment' ) eq ' ---' , ' token: endcomment' );
28
- ok( $xdi -> token(' energycolumn' ) eq ' energy' , ' token: energycolumn' );
29
- ok( $xdi -> token(' anglecolumn' ) eq ' angle' , ' token: anglecolumn' );
30
- ok( $xdi -> token(' version' ) eq ' XDI/' , ' token: version' );
31
- ok( $xdi -> token(' edge' ) eq ' element.edge' , ' token: edge' );
32
- ok( $xdi -> token(' element' ) eq ' element.symbol' , ' token: element' );
33
- ok( $xdi -> token(' column' ) eq ' column.' , ' token: column' );
34
- ok( $xdi -> token(' dspacing' ) eq ' mono.d_spacing' , ' token: dspacing' );
35
- ok( $xdi -> token(' glorb' ) eq ' ' , ' token: not a token' );
19
+ ok($xdi =~ m { Xray::XDI} , ' created Xray::XDI object' );
20
+ ok($xdi -> ok, ' ok flag is true' );
21
+ ok($xdi -> error eq ' ' , ' error text is empty' );
22
+
23
+ ok( $xdi -> token(' comment' ) eq ' #' , ' token: comment' );
24
+ ok( $xdi -> token(' delimiter' ) eq ' :' , ' token: delimiter' );
25
+ ok( $xdi -> token(' dot' ) eq ' .' , ' token: dot' );
26
+ ok( $xdi -> token(' startcomment' ) eq ' ///' , ' token: startcomment' );
27
+ ok( $xdi -> token(' endcomment' ) eq ' ---' , ' token: endcomment' );
28
+ ok( $xdi -> token(' energycolumn' ) eq ' energy' , ' token: energycolumn' );
29
+ ok( $xdi -> token(' anglecolumn' ) eq ' angle' , ' token: anglecolumn' );
30
+ ok( $xdi -> token(' version' ) eq ' XDI/' , ' token: version' );
31
+ ok( $xdi -> token(' edge' ) eq ' element.edge' , ' token: edge' );
32
+ ok( $xdi -> token(' element' ) eq ' element.symbol' , ' token: element' );
33
+ ok( $xdi -> token(' column' ) eq ' column.' , ' token: column' );
34
+ ok( $xdi -> token(' dspacing' ) eq ' mono.d_spacing' , ' token: dspacing' );
35
+ ok( $xdi -> token(' timestamp' ) eq ' scan.start_time' , ' token: timestamp' );
36
+ ok( $xdi -> token(' glorb' ) eq ' ' , ' token: "glorb" is not a token' );
36
37
37
38
my @edges = $xdi -> valid_edges;
38
39
ok($#edges == 26, ' edge symbols' );
@@ -41,7 +42,7 @@ ok($#elements == 117, 'element symbols');
41
42
42
43
43
44
ok($xdi -> filename =~ m { co_metal_rt.xdi} , ' filename' );
44
- ok($xdi -> xdi_libversion eq ' 1.0 .0' , ' xdi_libversion' );
45
+ ok($xdi -> xdi_libversion eq ' 1.1 .0' , ' xdi_libversion' );
45
46
ok($xdi -> xdi_version >= 1.0, ' xdi_version' );
46
47
ok($xdi -> extra_version =~ m { GSE} , ' extra_version' );
47
48
@@ -66,7 +67,7 @@ ok($count == $xdi->nmetadata, 'correct numbe
66
67
ok($xdi -> metadata-> {Mono }-> {name } eq ' Si 111' , ' fetching Mono.name' );
67
68
ok($xdi -> metadata-> {Facility }-> {xray_source } eq ' APS undulator A' , ' fetching Facility.xray_source' );
68
69
69
- ok($xdi -> npts == 418 , ' npts' );
70
+ ok($xdi -> npts == 417 , ' npts' );
70
71
ok($xdi -> narrays == 3, ' narrays' );
71
72
ok($xdi -> narrays == $xdi -> narray_labels, ' narray_labels' );
72
73
0 commit comments