Skip to content

Commit

Permalink
tests to ensure proper array type handling
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin committed Dec 27, 2023
1 parent 4653ccc commit a10576b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/test_functionlenses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using Test
using Dates
using Unitful
using LinearAlgebra: norm
using AxisKeys
using InverseFunctions: inverse
using Accessors: test_getset_laws, test_modify_law
using Accessors
Expand Down Expand Up @@ -170,6 +171,10 @@ end
B = @set reverse(vec(A)) = 1:6
@test B == [6 4 2; 5 3 1]

C = KeyedArray([1,2,3], x=[:a, :b, :c])
@test (@set vec(C) = [5,6,7])::KeyedArray == KeyedArray([5,6,7], x=[:a, :b, :c])
@test (@set reverse(C) = [5,6,7])::KeyedArray == KeyedArray([7,6,5], x=[:a, :b, :c])

test_getset_laws(size, A, (1, 6), (3, 2))
test_getset_laws(vec, A, 10:15, 21:26)
test_getset_laws(reverse, collect(1:6), 10:15, 21:26)
Expand Down

0 comments on commit a10576b

Please sign in to comment.