### Navigation

- index
- Ada modules |
- next |
- previous |
- Ahven 2.2 documentation »
- API Documentation for Ahven »

# `Ahven` – Package

## Exceptions

Assertion_Error

> Exception, raised when Assert fails.

## Procedures and Functions

### Assert

    procedure Assert (Condition : Boolean; Message : String);

If Condition is false, Assert raises Assertion_Error with given Message.

### Assert_Equal

New in version 1.4.

    generic
       type Data_Type is private;
       with function Image (Item : Data_Type) return String is <>;
    procedure Assert_Equal (Actual : Data_Type; Expected : Data_Type; Message : String);

If Expected /= Actual, Assert raises Assertion_Error with given Message.

Example:

    declare
       procedure Assert_Eq_Nat is
         new Ahven.Assert_Equal (Data_Type => Natural,
                                 Image     => Natural'Image);

    begin
       Assert_Eq_Nat (Actual   => Test_Count,
                      Expected => 4,
                      "test count");
    end;

### Fail

    procedure Fail (Message : String);

Fail always raises Assertion_Error with given Message.

### Skip

New in version 2.0.

    procedure Skip (Message : String);

Skip always raises Test_Skipped_Error with given Message.

### Navigation

- index
- Ada modules |
- next |
- previous |
- Ahven 2.2 documentation »
- API Documentation for Ahven »