Skip to content

Commit 340bc14

Browse files
authored
Test for fits_read_descript (#50)
* Test for `fits_read_descript` * Change testset name
1 parent fbb7ad0 commit 340bc14

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/runtests.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,4 +1015,23 @@ end
10151015
@test names_read == names
10161016
end
10171017
end
1018+
1019+
@testset "variable length column in binary table" begin
1020+
tempfitsfile() do f
1021+
# Create a binary table with variable-length column
1022+
cols = [
1023+
("col1", "1PJ", ""),
1024+
]
1025+
fits_create_binary_tbl(f, 0, cols, "VARLEN")
1026+
1027+
data = Int32[10, 20, 30]
1028+
CFITSIO.fits_write_col(f, 1, 1, 1, data)
1029+
1030+
nelem, heap_offset = CFITSIO.fits_read_descript(f, 1, 1)
1031+
1032+
# Step 4: Assertions
1033+
@test nelem == 3
1034+
@test heap_offset 0 # Offset in heap should be non-negative
1035+
end
1036+
end
10181037
end

0 commit comments

Comments
 (0)