Skip to content

Commit

Permalink
🤖 Format .jl files (#474)
Browse files Browse the repository at this point in the history
Co-authored-by: tmigot <[email protected]>
  • Loading branch information
github-actions[bot] and tmigot authored Jul 29, 2024
1 parent 6ebae68 commit 7beed5f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions test/nlp/meta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,23 @@ end

@testset "Meta copier." begin
nlp = SimpleNLPModel()

# Check simple copy
meta = NLPModelMeta(nlp.meta)
for field in fieldnames(typeof(nlp.meta))
@test getfield(nlp.meta, field) == getfield(meta, field)
end

modif = Dict(:nnzh => 1, :x0 => [2.0; 2.0; 0.0], :nvar => 3, :lvar => zeros(3), :uvar => [1.0; 1.0; 0.0])
modif = Dict(
:nnzh => 1,
:x0 => [2.0; 2.0; 0.0],
:nvar => 3,
:lvar => zeros(3),
:uvar => [1.0; 1.0; 0.0],
)
meta = NLPModelMeta(nlp.meta; modif...)
for field in setdiff(fieldnames(typeof(nlp.meta)), union(keys(modif),[:ifix]))

for field in setdiff(fieldnames(typeof(nlp.meta)), union(keys(modif), [:ifix]))
@test getfield(nlp.meta, field) == getfield(meta, field)
end
for field in keys(modif)
Expand Down

0 comments on commit 7beed5f

Please sign in to comment.