Changeset 4224 for trunk/library/lgtunit.lgt
- Timestamp:
- 04/25/08 02:24:26 (6 months ago)
- Files:
-
- 1 modified
-
trunk/library/lgtunit.lgt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/library/lgtunit.lgt
r3825 r4224 3 3 4 4 :- info([ 5 version is 0. 2,5 version is 0.3, 6 6 author is 'Paulo Moura', 7 date is 200 7/08/27,7 date is 2008/04/25, 8 8 comment is 'Logtalk unit test framework.']). 9 10 :- uses(term, [subsumes/2]). 9 11 10 12 :- public(succeeds/2). … … 12 14 :- info(succeeds/2, [ 13 15 comment is 'Defines a test goal which is expected to succeed.', 14 argnames is [' Test', 'Goal']]).16 argnames is ['Identifier', 'Goal']]). 15 17 16 18 :- public(fails/2). … … 18 20 :- info(fails/2, [ 19 21 comment is 'Defines a test goal which is expected to fail.', 20 argnames is [' Test', 'Goal']]).22 argnames is ['Identifier', 'Goal']]). 21 23 22 24 :- public(throws/3). … … 24 26 :- info(throws/3, [ 25 27 comment is 'Defines a test goal which is expected to throw an error.', 26 argnames is [' Test', 'Goal', 'Error']]).28 argnames is ['Identifier', 'Goal', 'Error']]). 27 29 28 30 :- public(run/2). … … 83 85 84 86 test_throws(Test, Goal, Error) :- 85 ( catch({Goal}, Ball, (( Ball = Error-> passed_test(Test, Goal); failed_test(Test, Goal)), Flag = error)) ->87 ( catch({Goal}, Ball, ((subsumes(Error, Ball) -> passed_test(Test, Goal); failed_test(Test, Goal)), Flag = error)) -> 86 88 ( var(Flag) -> 87 89 failed_test(Test, Goal)
