Changeset 4224

Show
Ignore:
Timestamp:
04/25/08 02:24:26 (2 months ago)
Author:
pmoura
Message:
Corrected a bug in the library object "lgtunit" when running "throws" tests (make sure the generated exception is subsumed by the expected exception). Added a "lgtunit_loader" loader utility file for loading the Logtalk unit test library.
Location:
trunk
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/testing/loader.lgt

    r3853 r4224  
    11 
    22:- initialization(( 
    3     logtalk_load(library(lgtunit), [reload(skip)]),     % allow for static binding 
     3    logtalk_load(library(lgtunit_loader), [reload(skip)]),      % allow for static binding 
    44    logtalk_load(testing))). 
  • trunk/library/all_loader.lgt

    r3853 r4224  
    77        library(dependents_loader), 
    88        library(hierarchies_loader), 
     9        library(lgtunit_loader), 
    910        library(metapredicates_loader), 
    1011        library(random_loader), 
  • trunk/library/lgtunit.lgt

    r3825 r4224  
    33 
    44    :- info([ 
    5         version is 0.2, 
     5        version is 0.3, 
    66        author is 'Paulo Moura', 
    7         date is 2007/08/27, 
     7        date is 2008/04/25, 
    88        comment is 'Logtalk unit test framework.']). 
     9 
     10    :- uses(term, [subsumes/2]). 
    911 
    1012    :- public(succeeds/2). 
     
    1214    :- info(succeeds/2, [ 
    1315        comment is 'Defines a test goal which is expected to succeed.', 
    14         argnames is ['Test', 'Goal']]). 
     16        argnames is ['Identifier', 'Goal']]). 
    1517 
    1618    :- public(fails/2). 
     
    1820    :- info(fails/2, [ 
    1921        comment is 'Defines a test goal which is expected to fail.', 
    20         argnames is ['Test', 'Goal']]). 
     22        argnames is ['Identifier', 'Goal']]). 
    2123 
    2224    :- public(throws/3). 
     
    2426    :- info(throws/3, [ 
    2527        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']]). 
    2729 
    2830    :- public(run/2). 
     
    8385 
    8486    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)) -> 
    8688            (   var(Flag) -> 
    8789                failed_test(Test, Goal) 
  • trunk/library/NOTES.txt

    r4102 r4224  
    1717    | ?- logtalk_load(library(random_loader)). 
    1818 
    19 Currently, there are nine groups of entities defined, each one with its  
     19Currently, there are ten groups of entities defined, each one with its  
    2020own loader and notes files: 
    2121 
     
    4141 
    4242    lgtunit 
    43         lgtunit.lgt 
     43        lgtunit_loader.lgt 
    4444        lgtunit.notes 
    4545 
  • trunk/RELEASE_NOTES.txt

    r4223 r4224  
    6767    for lists with unbound tails after discussion with Jan Wielemaker and  
    6868    Ulrich Neumerkel. 
     69 
     70    Corrected a bug in the library object "lgtunit" when running "throws"  
     71    tests (make sure the generated exception is subsumed by the expected  
     72    exception). Added a "lgtunit_loader" loader utility file for loading  
     73    the Logtalk unit test library. 
    6974 
    7075    Added a simple example, "debug_hooks", of using compilation hooks and