Skip to content

Commit

Permalink
Add missing test file
Browse files Browse the repository at this point in the history
  • Loading branch information
THinnerichs committed Jan 22, 2024
1 parent 6c32dc1 commit 132f282
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/test_ioproblem.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Tests for IOExample
@testset "IOExample Tests" begin
input_dict = Dict(:var1 => 42, :var2 => "value")
output_value = "test output"
io_example = IOExample(input_dict, output_value)

@test io_example.in == input_dict
@test io_example.out == output_value
end

# Tests for Problem
@testset "Problem Tests" begin
# Create a vector of IOExample instances as specification
spec = [IOExample(Dict(:var1 => 1, :var2 => 2), 3), IOExample(Dict(:var1 => 4, :var2 => 5), 6)]

# Test constructor without a name
problem1 = Problem(spec)
@test problem1.name == ""
@test problem1.spec === spec

# Test constructor with a name
problem_name = "Test Problem"
problem2 = Problem(problem_name, spec)
@test problem2.name == problem_name
@test problem2.spec === spec
end

2 comments on commit 132f282

@THinnerichs
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/99306

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 132f28253711b14301cc961812d290dd6ae6ef10
git push origin v0.1.0

Please sign in to comment.