Skip to content

Commit fcea52d

Browse files
the group names of a dataset without groups should be [] for consistency
1 parent 46f22f4 commit fcea52d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/dataset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ sync(ds::AbstractDataset) = nothing
3333
All the subgroup names of the data set `ds`. For a data set containing
3434
only a single group, this will be an empty vector of `String`.
3535
"""
36-
groupnames(ds::AbstractDataset) = ()
36+
groupnames(ds::AbstractDataset) = []
3737

3838

3939
"""

test/test_empty.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ end
55

66

77
dd = DummyEmptyDataset();
8-
@test CDM.dimnames(dd) == ()
8+
@test length(CDM.dimnames(dd)) == 0
99
@test_throws Exception CDM.dim(dd,"does_not_exist")
1010
@test_throws Exception CDM.defDim(dd,"does_not_exist",1)
1111

12-
@test CDM.attribnames(dd) == ()
12+
@test length(CDM.attribnames(dd)) == 0
1313
@test_throws Exception CDM.attrib(dd,"does_not_exist")
1414
@test_throws Exception CDM.defAttrib(dd,"does_not_exist",1)
1515

16-
@test CDM.varnames(dd) == ()
16+
@test length(CDM.varnames(dd)) == 0
1717
@test_throws Exception CDM.variable(dd,"does_not_exist")
1818
@test_throws Exception CDM.defVar(dd,"does_not_exist",Int32,())
1919

2020
@test CDM.path(dd) == ""
2121

22-
@test CDM.groupnames(dd) == ()
22+
@test length(CDM.groupnames(dd)) == 0
2323
# not available in julia 1.6
2424
#@test_throws "no group" CDM.group(dd,"does_not_exist")
2525
#@test_throws "unimplemented" CDM.defGroup(dd,"does_not_exist")

0 commit comments

Comments
 (0)