mlliarm / ia

An interval arithmetic library in Logtalk
Apache License 2.0
2 stars 0 forks source link

Tests #7

Closed mlliarm closed 2 years ago

mlliarm commented 4 years ago

Keeping track of tests inside tests.lgt.

pmoura commented 4 years ago

Actually, https://logtalk.org/coding_style_guidelines.html#source-code-layout-and-indentation 🙃 But following these guidelines is only a requirement when contributing to the Logtalk distribution. In any case, you may want to read https://alexandersandberg.com/tabs-for-accessibility/

mlliarm commented 4 years ago

Actually, https://logtalk.org/coding_style_guidelines.html#source-code-layout-and-indentation But following these guidelines is only a requirement when contributing to the Logtalk distribution. In any case, you may want to read https://alexandersandberg.com/tabs-for-accessibility/

Thanks, I'll check them out! It seems that there was an issue with the tabs on Github, so I've used spaces instead this time.

pmoura commented 4 years ago

See the .editorconfig file at the root of the Logtalk distribution:

https://github.com/LogtalkDotOrg/logtalk3/blob/master/.editorconfig

Feel free to copy it to this project if it solves the issue you mention with the tabs on Github.

mlliarm commented 2 years ago

Installed the latest version of Logtalk (3.52.0) on my Ubuntu laptop.

Run the tests and got the following code coverage:

% clause coverage ratio and covered clauses per entity predicate
% 
% interval_arithmetic: add/3 - 1/1 - (all)
% interval_arithmetic: divide/3 - 1/1 - (all)
% interval_arithmetic: hull/3 - 1/1 - (all)
% interval_arithmetic: intersection/3 - 1/1 - (all)
% interval_arithmetic: is_in/2 - 1/1 - (all)
% interval_arithmetic: magnitude/2 - 1/1 - (all)
% interval_arithmetic: midpoint/2 - 1/1 - (all)
% interval_arithmetic: mignitude/2 - 1/1 - (all)
% interval_arithmetic: mul/3 - 1/1 - (all)
% interval_arithmetic: multiply/3 - 1/1 - (all)
% interval_arithmetic: new/3 - 1/1 - (all)
% interval_arithmetic: subtract/3 - 1/1 - (all)
% interval_arithmetic: width/2 - 1/1 - (all)
% interval_arithmetic: sub/3 - 0/1 - []
% interval_arithmetic: mid/2 - 0/1 - []
% interval_arithmetic: wid/2 - 0/1 - []
% interval_arithmetic: mag/2 - 0/1 - []
% interval_arithmetic: mig/2 - 0/1 - []
% interval_arithmetic: 13 out of 18 clauses covered, 72.222222% coverage
% 
% 1 entity declared as covered containing 18 clauses
% 1 out of 1 entity covered, 100.000000% entity coverage
% 13 out of 18 clauses covered, 72.222222% clause coverage

Works has to be done. I'll see if I can fix at least 1 predicate tonight.

mlliarm commented 2 years ago

Achieved 100% clause coverage (20/20), thanks to @pmoura.

All good.

When the time comes to create new tests, I'll create a new issue, specific to the predicates to be tested (eg. interval trig. functions, interval exp, interval sqrt, interval Newton, interval Bisection).

For this reason I'll close this issue after the commit will be pushed.