Skip to content

Commit 1d75988

Browse files
author
Michael Abbott
committed
test with Dates
1 parent fcdcaa2 commit 1d75988

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ julia = "1"
2525

2626
[extras]
2727
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
28+
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
2829
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2930
UniqueVectors = "2fbcfb34-fd0c-5fbb-b5d7-e826d8f5b0a9"
3031

3132
[targets]
32-
test = ["BenchmarkTools", "Test", "UniqueVectors"]
33+
test = ["BenchmarkTools", "Dates", "Test", "UniqueVectors"]

test/_packages.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Test, AxisKeys
2-
using OffsetArrays, Tables, UniqueVectors, LazyStack
2+
using OffsetArrays, UniqueVectors, Tables, LazyStack, Dates
33

44
@testset "offset" begin
55

@@ -57,3 +57,13 @@ end
5757
@test axiskeys(stack(n for n in nts), 1) == [:i, :j, :k]
5858

5959
end
60+
@testset "dates" begin
61+
62+
D = wrapdims(rand(2,53), row = [:one, :two], week = Date(2020):Week(1):Date(2021))
63+
w9 = axiskeys(D,:week)[9]
64+
@test w9 isa Date
65+
@test D(w9) == D[week=9]
66+
# But steps of Year(1) don't work, https://github.com/JuliaLang/julia/issues/35203
67+
68+
end
69+

0 commit comments

Comments
 (0)