Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #19

Open
meyde opened this issue Jul 20, 2023 · 3 comments
Open

Test #19

meyde opened this issue Jul 20, 2023 · 3 comments

Comments

@meyde
Copy link
Collaborator

meyde commented Jul 20, 2023

We talked about tests that would help in testing if changes to the code broke anything. how should i present it? the test code is pretty simple, should i just make a test.jl file and put it in src, or do i need a test folder?

@natema
Copy link
Member

natema commented Jul 20, 2023

You need a test folder, plz read the docs https://docs.julialang.org/en/v1/stdlib/Test/ ; you can also see an example in https://github.com/worlddynamics/WorldDynamics.jl .

@meyde
Copy link
Collaborator Author

meyde commented Jul 20, 2023

would this file work in a folder named test? :

using Vensim2MTK, Test, ModelingToolkit

filepaths=["..\examples\Dice.xmile","..\examples\Lokta.xmile","..\examples\commitment2.xmile","..\examples\community corona 8.xmile"]
for filepath in filepaths
vensim2MTK(filepath, splitext(basename(filepath))[1] * ".jl",true)
end
@testset verboe=true "Vensim2MTK.jl" begin
@test isa(Dice.solved, ModelingToolkit.ODESystem)
@test isa(Lokta.solved, ModelingToolkit.ODESystem)
@test isa(commitment.solved, ModelingToolkit.ODESystem)
@test isa(community_corona_8.solved, ModelingToolkit.ODESystem)
end

@aurorarossi
Copy link
Member

I fixed the tests in the PR #36
Dice is a file, so when you write Dice.solved you are not accessing the solved variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants