@@ -5,6 +5,24 @@ SAMPLES_DIR = joinpath(@__DIR__, "samples")
55
66
77@testset " Issues" begin
8+ # issue 9 — fixed-size array branches ([N]/D, [M][N]/D, name[N]/D)
9+ rootfile = UnROOT. samplefile (" issue9.root" )
10+ @test_throws " is a TTree" UnROOT. array (rootfile, " arrays" )
11+ @test_throws " is a TTree" UnROOT. array (rootfile, " structs" )
12+ # individual branch reading
13+ @test UnROOT. array (rootfile, " arrays/nInt" ) == Int32[1 ]
14+ @test UnROOT. array (rootfile, " arrays/6dVec" ) == [UnROOT. FixLenVector (SVector {6,Float64} (1 ,2 ,3 ,4 ,5 ,6 ))]
15+ @test UnROOT. array (rootfile, " arrays/2x3Mat" ) == [UnROOT. FixLenVector (SVector {6,Float64} (1 ,2 ,3 ,4 ,5 ,6 ))]
16+ @test UnROOT. array (rootfile, " structs/2x3mat" ) == [UnROOT. FixLenVector (SVector {6,Float64} (1 ,2 ,3 ,4 ,5 ,6 ))]
17+ # LazyTree and arrays() (plural) work
18+ t = LazyTree (rootfile, " arrays" )
19+ @test t[1 ]. nInt == 1
20+ @test t[1 ]. var"6dVec" == UnROOT. FixLenVector (SVector {6,Float64} (1 ,2 ,3 ,4 ,5 ,6 ))
21+ res = UnROOT. arrays (rootfile, " structs" )
22+ @test res[1 ] == Int32[1 ]
23+ @test res[2 ] == [UnROOT. FixLenVector (SVector {6,Float64} (1 ,2 ,3 ,4 ,5 ,6 ))]
24+ close (rootfile)
25+
826 rootfile = UnROOT. samplefile (" issue7.root" )
927 @test 2 == length (keys (rootfile))
1028 @test [1.0 , 2.0 , 3.0 ] == UnROOT. array (rootfile, " TreeD/nums" )
0 commit comments