Skip to content

Commit

Permalink
Merge pull request #21 from emmt/main
Browse files Browse the repository at this point in the history
 Add tests related to issue #19
  • Loading branch information
emmt authored Jan 29, 2024
2 parents 6c30115 + bfffb13 commit b49d021
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,19 @@ end
end
end
end

@testset "User examples" begin
# See https://github.com/libprima/PRIMA.jl/issues/19
let cost_func(x) = sum(abs2, x), x0 = randn(4),
opts = (rhobeg=0.1, rhoend=1e-8)
@testset "$algo" for algo in (:uobyqa, :newuoa, :bobyqa,
:cobyla, :lincoa, :prima)
optim = optimizer(algo)
x1, res = @inferred optim(cost_func, x0; opts...)
@test maximum(abs.(x1)) 1e-8
end
end
end
end

nothing

1 comment on commit b49d021

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@check-spelling-bot Report

🔴 Please review

See the 📜action log or 📝 job summary for details.

Unrecognized words (8)

nlin
nlp
nnln
nvar
PRIMACUT
PRIMANLP
uvar
weakdeps

To accept these unrecognized words as correct, you could run the following commands

... in a clone of the [email protected]:libprima/PRIMA.jl.git repository
on the main branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/libprima/PRIMA.jl/actions/runs/7693270119/attempts/1'
Errors (1)

See the 📜action log or 📝 job summary for details.

❌ Errors Count
❌ check-file-path 2

See ❌ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Please sign in to comment.