Skip to content

Commit

Permalink
fix tests and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
brucala committed Jan 17, 2025
1 parent 898da03 commit 0c83536
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ Data(;
format=nothing,
) = DataSpec(_remove_empty(;url, format, name))
function Data(generator::SymbolOrString; kw...)
kw = isempty(kw) ? true : kw
Data(NamedTuple{(generator,)}((NamedTuple(kw), )))
kw = isempty(kw) ? true : NamedTuple(kw)
Data(NamedTuple{(generator,)}((kw, )))
end
Data(key::SymbolOrString, value::SymbolOrString) = Data(NamedTuple{(key,)}((value, )))

Expand Down
3 changes: 2 additions & 1 deletion test/test_api.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ end
@test rawspec(Data(3)) == 3
@test Data(url="url") isa Deneb.DataSpec
@test Data(url="url").data == (;url="url")
@test Data(:graticule, step=[15, 15]).data == (graticule = (step = [15, 15],),)
@test Data(:graticule, step=[15, 15]).data == (;graticule = (;step = [15, 15]))
@test Data(:sphere).data == (;sphere = true)
@test Data(:name, :nodes).data == (;name=:nodes)
end

Expand Down

0 comments on commit 0c83536

Please sign in to comment.