Skip to content

Commit

Permalink
printing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pdeffebach committed Feb 27, 2024
1 parent f8f46ac commit 2d92d81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ addition to notes. However column labels are not returned by
"""
function printnotes(df, cols = All(); unnoted = false)
nms = names(df, cols)
# "Column: " has 8 characters
for n in nms
nt = note(df, n)
lab = label(df, n)
Expand All @@ -248,6 +247,7 @@ function printnotes(df, cols = All(); unnoted = false)
end

function printnote(n, nt, lab, no_note, no_lab)
# "Column: " has 8 characters
println("Column: $n")
println(repeat("", length(n) + 8))
if no_lab == false
Expand Down
4 changes: 4 additions & 0 deletions test/metadata.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,17 @@ end
printlabels(df, :a)
printlabels(df, [:a, :b])
printlabels(df; unlabelled = true)
printlabels(df; unlabelled = false)
printlabels(df, [:a, :b], unlabelled = false)
printlabels(df, [:a, :b], unlabelled = true)

printnotes(df)
printnotes(df, :a)
printnotes(df, [:a, :b])
printnotes(df; unnoted = true)
printnotes(df; unnoted = false)
printnotes(df, [:a, :b], unnoted = false)
printnotes(df, [:a, :b], unnoted = true)
end

end # module

0 comments on commit 2d92d81

Please sign in to comment.