Commit bfa0717e authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

fixing some tests

parent cd692f32
:- use_module(library(plunit)).
:- begin_tests(conservation_laws, [setup(new_model)]).
:- begin_tests(conservation_laws).
test(
'add_conservation adds a conservation',
[
setup(models:clear_model),
cleanup(models:clear_model),
true(Conservations == [[1*'a-a', 2*'a']])
]
) :-
command(add_conservation([a-a, 2*a])),
command(add_conservation(a-a + 2*a)),
all_items([model: current_model, kind: conservation], Conservations).
test(
'delete_conservation deletes the correct conservation',
[
true(Conservations == [[1*'a-a', 2*'a'], [1*'c-c', 2*'c']]),
setup(add_some_conservations)
setup(models:clear_model,add_some_conservations),
cleanup(models:clear_model),
true(Conservations == [[1*'a-a', 2*'a'], [1*'c-c', 2*'c']])
]
) :-
command(delete_conservation([b-b, 2*b])),
command(delete_conservation(b-b + 2*b)),
all_items([model: current_model, kind: conservation], Conservations).
test(
'delete_conservations deletes all conservations',
[
true(Conservations == []),
setup(add_some_conservations)
setup(models:clear_model,add_some_conservations),
cleanup(models:clear_model),
true(Conservations == [])
]
) :-
command(delete_conservations),
......@@ -37,9 +41,9 @@ test(
add_some_conservations :-
command(add_conservation([a-a, 2*a])),
command(add_conservation([b-b, 2*b])),
command(add_conservation([c-c, 2*c])).
command(add_conservation(a-a + 2*a)),
command(add_conservation(b-b + 2*b)),
command(add_conservation(c-c + 2*c)).
% test('compound', [true(Rules == [2 * a + 2 * b => 2 * 'a-b'])]) :-
% new_model,
% command(add_rule(2 * a + 2 * b => 2 * a-b)),
......
......@@ -56,6 +56,7 @@
- aliases.plt
*** Algebraic invariants, conservation laws and P-invariants
- conservation_laws.pl
- conservation_laws.plt
** Simulations
*** ODE and stochastic simulations
- numerical_simulation.pl
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment