Skip to content

Commit c2a92f9

Browse files
committed
test different eltypes
1 parent 7a24cd4 commit c2a92f9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/test_getsetall.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ if VERSION >= v"1.6" # for ComposedFunction
4141
@test (2, 5, 10, 17, 26, 37) === @inferred getall(obj, @optic _ |> _[:] |> Elements() |> Elements() |> _[:] |> Elements() |> Elements() |> _[1]^2 + 1 |> only)
4242

4343
# trickier types for Elements():
44-
obj = (a=("ab", "c"), b=([1 2; 3 4],), c=(SVector(1), SVector(2, 3)))
44+
obj = (a=("ab", "c"), b=([1 2; 3 4],), c=(SVector(1.), SVector(2, 3)))
4545
@test ['b', 'c', 'd'] == @inferred getall(obj, @optic _.a |> Elements() |> Elements() |> _ + 1)
4646
@test [2, 4, 3, 5] == @inferred getall(obj, @optic _.b |> Elements() |> Elements() |> _ + 1)
47-
@test (1, 2, 3) === @inferred getall(obj, @optic _.c |> Elements() |> Elements())
48-
@test (2, 3, 4) === @inferred getall(obj, @optic _.c |> Elements() |> Elements() |> _ + 1)
47+
@test (1., 2, 3) === @inferred getall(obj, @optic _.c |> Elements() |> Elements())
48+
@test (2., 3, 4) === @inferred getall(obj, @optic _.c |> Elements() |> Elements() |> _ + 1)
4949

5050
# composition order should not matter:
51-
@test (2, 3, 4) === @inferred getall(obj, (@optic(_ + 1) Elements() Elements()) @optic(_.c))
52-
@test (2, 3, 4) === @inferred getall(obj, (@optic(_ + 1) Elements()) (Elements() @optic(_.c)))
53-
@test (2, 3, 4) === @inferred getall(obj, @optic(_ + 1) (Elements() Elements() @optic(_.c)))
51+
@test (2., 3, 4) === @inferred getall(obj, (@optic(_ + 1) Elements() Elements()) @optic(_.c))
52+
@test (2., 3, 4) === @inferred getall(obj, (@optic(_ + 1) Elements()) (Elements() @optic(_.c)))
53+
@test (2., 3, 4) === @inferred getall(obj, @optic(_ + 1) (Elements() Elements() @optic(_.c)))
5454

5555
obj = ()
5656
@test () === @inferred getall(obj, @optic _ |> Elements() |> _ + 1)
@@ -118,7 +118,7 @@ end
118118
@test (a=1, b=((c=-3., d=-4.), (c=-5., d=-6.))) === @inferred setall(obj, @optic(_ * 3) (Properties() Elements() @optic(_.b)), [-9, -12, -15, -18])
119119

120120
# SVectors and nested Elements:
121-
obj = (c=(SVector(1), SVector(2, 3)),)
121+
obj = (c=(SVector(1.), SVector(2, 3)),)
122122
@test setall(obj.c[1], Elements(), (5, 6)) === SVector(5, 6)
123123
@test setall(obj.c[1], Elements(), (5,)) === SVector(5)
124124
@test setall(obj.c[1], Elements(), [5, 6]) === SVector(5, 6)

0 commit comments

Comments
 (0)