Skip to content

Commit

Permalink
Add test using JLArrays
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Dec 18, 2023
1 parent ee6f98f commit 214e1af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "StaticArrays"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.8.1"
version = "1.8.2"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down Expand Up @@ -30,10 +30,11 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[targets]
test = ["InteractiveUtils", "Test", "BenchmarkTools", "OffsetArrays", "Statistics", "Unitful", "Aqua", "ChainRulesTestUtils", "ChainRulesCore"]
test = ["InteractiveUtils", "Test", "BenchmarkTools", "OffsetArrays", "Statistics", "Unitful", "Aqua", "ChainRulesTestUtils", "ChainRulesCore", "JLArrays"]
9 changes: 8 additions & 1 deletion test/chainrules.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using StaticArrays, ChainRulesCore, ChainRulesTestUtils, Test
using StaticArrays, ChainRulesCore, ChainRulesTestUtils, JLArrays, Test

@testset "Chain Rules Integration" begin
@testset "Projection" begin
Expand Down Expand Up @@ -26,4 +26,11 @@ using StaticArrays, ChainRulesCore, ChainRulesTestUtils, Test
@inferred ProjectTo(x)(y)
@inferred ProjectTo(y)(x)
end

@testset "Array of Structs Projection" begin
x = JLArray(rand(SVector{3, Float64}, 10))
@inferred ProjectTo(x)
@inferred Union{Nothing, JLVector{SVector{3, Float64}}, DenseJLVector{SVector{3, Float64}}} ProjectTo(x)(x)
@test ProjectTo(x)(x) isa JLArray
end
end

0 comments on commit 214e1af

Please sign in to comment.