Skip to content

Commit a764b96

Browse files
committed
Add test for #847
1 parent 72b39f6 commit a764b96

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/diff.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,3 +483,18 @@ let
483483
@test collect(Symbolics.sparsehessian(ex, [a[1]])) == [2;;]
484484
@test collect(Symbolics.sparsehessian(ex, a)) == fill(2, 2, 2)
485485
end
486+
487+
# issue #847
488+
let
489+
@variables x[1:2] y[1:2]
490+
x = Symbolics.scalarize(x)
491+
y = Symbolics.scalarize(y)
492+
493+
z = (x[1] + x[2]) * (y[1] + y[2])
494+
@test Symbolics.islinear(z, x)
495+
@test Symbolics.isaffine(z, x)
496+
497+
z = (x[1] + x[2])
498+
@test Symbolics.islinear(z, x)
499+
@test Symbolics.isaffine(z, x)
500+
end

0 commit comments

Comments
 (0)