@@ -535,22 +535,25 @@ function test_IndexAtom()
535535 Convex. set_value! (x, [1 3 ; 2 4 ])
536536 @test Convex. evaluate .(z) == [1 , 2 , 4 ]
537537 # Base.getindex(x::AbstractExpr, I::BitVector)
538- y = BitVector ([true , false , true ])
539- x = Variable (3 )
540- z = x[y]
541- @test string (z) == string ([x[1 ], x[3 ]])
542- @test z isa Vector{Convex. IndexAtom}
543- @test length (z) == 2
544- Convex. set_value! (x, [1 , 2 , 3 ])
545- @test Convex. evaluate .(z) == [1 , 3 ]
538+ target = """
539+ variables: x1, x2, x3
540+ minobjective: [1.0 * x1, 1.0 * x3]
541+ """
542+ _test_atom (target) do context
543+ x = Variable (3 )
544+ y = BitVector ([true , false , true ])
545+ return x[y]
546+ end
546547 # Base.getindex(x::AbstractExpr, I::BitMatrix)
547- y = BitMatrix ([true false ; true true ])
548- x = Variable (2 , 2 )
549- z = x[y]
550- @test z isa Vector{Convex. IndexAtom}
551- @test length (z) == 3
552- Convex. set_value! (x, [1 3 ; 2 4 ])
553- @test Convex. evaluate .(z) == [1 , 2 , 4 ]
548+ target = """
549+ variables: x1, x2, x3, x4
550+ minobjective: [1.0 * x1, 1.0 * x2, 1.0 * x4]
551+ """
552+ _test_atom (target) do context
553+ x = Variable (2 , 2 )
554+ y = BitMatrix ([true false ; true true ])
555+ return x[y]
556+ end
554557 return
555558end
556559
0 commit comments