summaryrefslogtreecommitdiff
path: root/test/test_main.adb
blob: c741a93751ba9c58f3f15c399c9047912476b607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64


with

    Ada.Text_IO,
    Packrat,
    Ratnest.Tests;

use

    Ada.Text_IO,
    Ratnest,
    Ratnest.Tests;


procedure Test_Main is


    type My_Labels is (A, B, C);
    package My_Tokens is new Packrat.Tokens (My_Labels, Character, String);

    Err : Packrat.Errors.Error_Message := Packrat.Errors.Encode ("A", 1);
    Tok : My_Tokens.Token := My_Tokens.Create (A, 1, 3, "abc");


begin


    Put_Line ("Running tests for Packrat.Errors...");
    Run_Tests (Errors.Tests);
    New_Line;
    Put_Line ("Displaying Error_Message debug string output example:");
    Put (Packrat.Errors.Debug_String (Err));
    New_Line;

    Put_Line ("Running tests for Packrat.Tokens...");
    Run_Tests (Tokens.Tests);
    New_Line;
    Put_Line ("Displaying Token debug string output example:");
    Put (Tok.Debug_String);
    New_Line;

    Put_Line ("Running tests for Packrat.Lexer combinators...");
    Run_Tests (Lexer.Combinator_Tests);
    New_Line;

    Put_Line ("Running tests for Packrat.Lexer lexing...");
    Run_Tests (Lexer.Lexer_Tests);
    New_Line;

    Put_Line ("Running tests for Packrat.Graphs...");
    Run_Tests (Graphs.Graph_Tests);
    New_Line;

    Put_Line ("Running tests for Packrat.Util...");
    Put_Line ("Testing set predicates...");
    Run_Tests (Util.Set_Predicate_Tests);
    Put_Line ("Testing ordinary predicates...");
    Run_Tests (Util.Predicate_Tests);


end Test_Main;