From ee45858aa8df2b324aa7192a1f5cf835d0d265e8 Mon Sep 17 00:00:00 2001 From: odow Date: Tue, 5 Nov 2024 13:41:25 +1300 Subject: [PATCH] Add tests for iterating over a variable --- test/test_model.jl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/test_model.jl b/test/test_model.jl index c0786f9e13c..1d3fd1f92be 100644 --- a/test/test_model.jl +++ b/test/test_model.jl @@ -1338,4 +1338,14 @@ function test_set_abstract_string() return end +function test_iterate_scalar() + model = Model() + @variable(model, x) + @test collect(x) == [x] + @test !isempty(x) + @test iterate(x) == (x, true) + @test iterate(x, true) === nothing + return +end + end # module TestModels