@@ -23,6 +23,13 @@ for (buf, newbuf, idxs, vals) in [
2323 # skip non-parameters
2424 ([1 , 2 , 3 ], [2.0 , 3.0 , 3.0 ], [:a , :b , :(a + b)], [2.0 , 3.0 , 5.0 ])
2525]
26+ @test_deprecated remake_buffer (sys, buf, Dict (idxs .=> vals))
27+ for varmap in [Dict (idxs .=> vals), Dict {Any, Any} (idxs .=> vals)]
28+ _newbuf = remake_buffer (sys, buf, keys (varmap), values (varmap))
29+ @test _newbuf != buf
30+ @test newbuf == _newbuf
31+ @test typeof (newbuf) == typeof (_newbuf)
32+ end
2633 for arrType in [Vector, SVector{3 }, MVector{3 }, SizedVector{3 }]
2734 buf = arrType (buf)
2835 newbuf = arrType (newbuf)
@@ -31,7 +38,6 @@ for (buf, newbuf, idxs, vals) in [
3138 @test _newbuf != buf # should not alias
3239 @test newbuf == _newbuf # test values
3340 @test typeof (newbuf) == typeof (_newbuf) # ensure appropriate type
34- @test_deprecated remake_buffer (sys, buf, Dict (idxs .=> vals))
3541 end
3642end
3743
@@ -55,8 +61,13 @@ for (buf, newbuf, idxs, vals) in [
5561 # skip non-variables
5662 ([1 , 2 , 3 ], [2.0 , 3.0 , 3.0 ], [:x , :y , :(x + y)], [2.0 , 3.0 , 5.0 ])
5763]
64+ @test_deprecated remake_buffer (sys, buf, Dict (idxs .=> vals))
65+ for varmap in [Dict (idxs .=> vals), Dict {Any, Any} (idxs .=> vals)]
66+ _newbuf = remake_buffer (sys, buf, keys (varmap), values (varmap))
67+ @test newbuf == _newbuf
68+ @test typeof (newbuf) == typeof (_newbuf)
69+ end
5870 _newbuf = remake_buffer (sys, buf, idxs, vals)
5971 @test newbuf == _newbuf # test values
6072 @test typeof (newbuf) == typeof (_newbuf) # ensure appropriate type
61- @test_deprecated remake_buffer (sys, buf, Dict (idxs .=> vals))
6273end
0 commit comments