Skip to content

Commit 5dcc2fc

Browse files
committed
Test copy(Map(identity), eachrow(df))
1 parent 608418d commit 5dcc2fc

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1919
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2020
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
2121
StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
22+
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
2223
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2324
Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999"
2425
TypedTables = "9d95f2ec-7b3d-5a63-8d20-e2491e220bb9"

test/test_copy.jl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module TestCopy
22

33
include("preamble.jl")
4+
import Tables
45
using DataFrames: DataFrame, eachrow
56
using StructArrays: StructVector
67
using TypedTables: Table
@@ -30,8 +31,16 @@ end
3031
end
3132
@testset "$copy(_, eachrow(df))" begin
3233
df = DataFrame(a=[1:4;], b=[5:8;])
33-
@test_broken copy(Map(identity), eachrow(df)) ==ₜ df
34-
# requires https://github.com/JuliaData/DataFrames.jl/pull/2055
34+
if Tables.materializer(eachrow(df)) == DataFrame
35+
# requires https://github.com/JuliaData/DataFrames.jl/pull/2055
36+
if copy in (tcopy, dcopy)
37+
@test_broken copy(Map(identity), eachrow(df); basesize=1) ==ₜ df
38+
else
39+
@test copy(Map(identity), eachrow(df)) ==ₜ df
40+
end
41+
else
42+
@test_broken copy(Map(identity), eachrow(df)) ==ₜ df
43+
end
3544
end
3645
end
3746

0 commit comments

Comments
 (0)