simple, small test for error_handling

This commit is contained in:
Vítor Santos Costa 2016-02-21 11:32:08 +00:00
parent 2cacf6f63a
commit 20f639fe7b
4 changed files with 49 additions and 0 deletions

0
regression/errors.md Normal file
View File

47
regression/errors.yap Normal file
View File

@ -0,0 +1,47 @@
/**
* @file regression/errors.yap
* author Vitor Santos Costa
*
* @defgroup ErrorHandlerTesting Test Error Handler
* @ingroup Regression System Tests
*
* Just check if the error handler is up to scratch..
*/
:- style_check(all).
:- discontiguous main/0.
:- initialization(main).
:- initialization( open('errors.md', write, _Out, [alias(user_error)]), now ).
:- format(user_error, ' Report on error handling~n~n', []).
%% + discontiguous
:- format(user_error, ' + warning: style check discontiguous~n~n~*c~n', [4,0'~,4,0'~]).
a(1).
a(2,2).
a(1).
%% + multifile
:- format(user_error, '~*c~n~n + warning: style check multifile~n~*c~n', [4,0'~,4,0'~]).
:- load_files(mu1,[silent(true)]).
:- load_files(mu2,[silent(true)]).
%% + singleton
:- format(user_error, '~*c~n~n + warning: style check singleton~n~*c~n', [4,0'~,4,0'~]).
a(X). % X
a(_X). % no msg
a :- b(X) ; c(X). %no msg
:- format(user_error, '~*c~n', [4,0'~]).
%% end of tests,
main.

1
regression/mu1.yap Normal file
View File

@ -0,0 +1 @@
a(1).

1
regression/mu2.yap Normal file
View File

@ -0,0 +1 @@
a(2).