Skip to content

Commit 9282b1c

Browse files
committed
Testcase: exceptions renaming.
1 parent 9bfd421 commit 9282b1c

File tree

5 files changed

+136
-31
lines changed

5 files changed

+136
-31
lines changed

testsuite/als_helper/exceptions_package.adb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
with Exceptions; use Exceptions;
1+
with Exceptions;
2+
with Exceptions_Renamings;
23

34
package body Exceptions_Package is
45

56
procedure Dummy is
67
begin
78
begin
8-
raise Test_Exception;
9+
raise Exceptions.Test_Exception;
910

1011
exception
11-
when Test_Exception =>
12+
when Exceptions.Test_Exception =>
13+
null;
14+
end;
15+
16+
begin
17+
raise Exceptions_Renamings.Renamed_Test_Exception;
18+
19+
exception
20+
when Exceptions_Renamings.Renamed_Test_Exception =>
1221
null;
1322
end;
1423
end Dummy;
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
package body Exceptions_Renamings is
3+
4+
procedure Dummy is
5+
begin
6+
begin
7+
raise Renamed_Test_Exception;
8+
9+
exception
10+
when Renamed_Test_Exception =>
11+
null;
12+
end;
13+
end Dummy;
14+
15+
end Exceptions_Renamings;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
with Exceptions;
3+
4+
package Exceptions_Renamings is
5+
6+
Renamed_Test_Exception : exception;
7+
-- Description of the renamed exception
8+
9+
private
10+
11+
procedure Dummy;
12+
13+
end Exceptions_Renamings;

testsuite/als_helper/locations.json

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,32 @@
8787
{"file": "discriminant_record_types_package.adb", "line": 36, "column": 26},
8888
// reference: `Known_Discriminant_Private_Null_Record`
8989

90+
// Exceptions (declarations and renamings)
91+
92+
{"file": "exceptions.ads", "line": 4, "column": 4},
93+
// declaration of the exception
94+
{"file": "exceptions.adb", "line": 7, "column": 16},
95+
// reference of the exception
96+
{"file": "exceptions.adb", "line": 10, "column": 15},
97+
// reference of the exception
98+
{"file": "exceptions_package.adb", "line": 9, "column": 27},
99+
// reference of the exception
100+
{"file": "exceptions_package.adb", "line": 12, "column": 26},
101+
// reference of the exception
102+
103+
{"file": "exceptions_renamings.ads", "line": 6, "column": 4},
104+
// renaming of the exception
105+
{"file": "exceptions_renamings.adb", "line": 7, "column": 16},
106+
// reference of the renamed exception
107+
{"file": "exceptions_renamings.adb", "line": 10, "column": 15},
108+
// reference of the renamed exception
109+
{"file": "exceptions_package.adb", "line": 17, "column": 37},
110+
// reference of the renamed exception
111+
{"file": "exceptions_package.adb", "line": 20, "column": 36},
112+
// reference of the renamed exception
113+
114+
// Objects
115+
90116
{"file": "objects.ads", "line": 4, "column": 4},
91117
// declaration: `Named_Number`
92118
{"file": "objects.adb", "line": 7, "column": 30},
@@ -152,13 +178,6 @@
152178
{"file": "objects_package.adb", "line": 68, "column": 43},
153179
// reference of `Renamed_Value`
154180

155-
{"file": "exceptions.ads", "line": 4, "column": 4},
156-
// declaration of the exception
157-
{"file": "exceptions.adb", "line": 7, "column": 16},
158-
// reference of the exception
159-
{"file": "exceptions_package.adb", "line": 8, "column": 16},
160-
// reference of the exception
161-
162181
// LAL 20250922: issue with package name resolution in the body doesn't allow to write test
163182
// {"file": "packages.ads", "line": 5, "column": 9},
164183
// // specification of the package

testsuite/als_helper/test.out

Lines changed: 70 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,76 @@ type Incomplete_Known_Discriminant_Private_Null_Record
502502
@field Discriminant
503503
Public description of the discriminant
504504
----- DONE -----
505+
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
506+
Origin: <Id "Test_Exception" exceptions.ads:4:4-4:18>
507+
----- CODE SNIPPET -----
508+
Test_Exception : exception;
509+
----- DOCUMENTATION -----
510+
Description of the exception
511+
----- DONE -----
512+
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
513+
Origin: <Id "Test_Exception" exceptions.adb:7:16-7:30>
514+
----- CODE SNIPPET -----
515+
Test_Exception : exception;
516+
----- DOCUMENTATION -----
517+
Description of the exception
518+
----- DONE -----
519+
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
520+
Origin: <Id "Test_Exception" exceptions.adb:10:15-10:29>
521+
----- CODE SNIPPET -----
522+
Test_Exception : exception;
523+
----- DOCUMENTATION -----
524+
Description of the exception
525+
----- DONE -----
526+
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
527+
Origin: <Id "Test_Exception" exceptions_package.adb:9:27-9:41>
528+
----- CODE SNIPPET -----
529+
Test_Exception : exception;
530+
----- DOCUMENTATION -----
531+
Description of the exception
532+
----- DONE -----
533+
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
534+
Origin: <Id "Test_Exception" exceptions_package.adb:12:26-12:40>
535+
----- CODE SNIPPET -----
536+
Test_Exception : exception;
537+
----- DOCUMENTATION -----
538+
Description of the exception
539+
----- DONE -----
540+
Defining name: <DefiningName "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
541+
Origin: <Id "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
542+
----- CODE SNIPPET -----
543+
Renamed_Test_Exception : exception;
544+
----- DOCUMENTATION -----
545+
Description of the renamed exception
546+
----- DONE -----
547+
Defining name: <DefiningName "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
548+
Origin: <Id "Renamed_Test_Exception" exceptions_renamings.adb:7:16-7:38>
549+
----- CODE SNIPPET -----
550+
Renamed_Test_Exception : exception;
551+
----- DOCUMENTATION -----
552+
Description of the renamed exception
553+
----- DONE -----
554+
Defining name: <DefiningName "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
555+
Origin: <Id "Renamed_Test_Exception" exceptions_renamings.adb:10:15-10:37>
556+
----- CODE SNIPPET -----
557+
Renamed_Test_Exception : exception;
558+
----- DOCUMENTATION -----
559+
Description of the renamed exception
560+
----- DONE -----
561+
Defining name: <DefiningName "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
562+
Origin: <Id "Renamed_Test_Exception" exceptions_package.adb:17:37-17:59>
563+
----- CODE SNIPPET -----
564+
Renamed_Test_Exception : exception;
565+
----- DOCUMENTATION -----
566+
Description of the renamed exception
567+
----- DONE -----
568+
Defining name: <DefiningName "Renamed_Test_Exception" exceptions_renamings.ads:6:4-6:26>
569+
Origin: <Id "Renamed_Test_Exception" exceptions_package.adb:20:36-20:58>
570+
----- CODE SNIPPET -----
571+
Renamed_Test_Exception : exception;
572+
----- DOCUMENTATION -----
573+
Description of the renamed exception
574+
----- DONE -----
505575
Defining name: <DefiningName "Named_Number" objects.ads:4:4-4:16>
506576
Origin: <Id "Named_Number" objects.ads:4:4-4:16>
507577
----- CODE SNIPPET -----
@@ -706,27 +776,6 @@ Renamed_Value : Integer renames Objects.Value;
706776
----- DOCUMENTATION -----
707777
Description of the renamed object
708778
----- DONE -----
709-
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
710-
Origin: <Id "Test_Exception" exceptions.ads:4:4-4:18>
711-
----- CODE SNIPPET -----
712-
Test_Exception : exception;
713-
----- DOCUMENTATION -----
714-
Description of the exception
715-
----- DONE -----
716-
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
717-
Origin: <Id "Test_Exception" exceptions.adb:7:16-7:30>
718-
----- CODE SNIPPET -----
719-
Test_Exception : exception;
720-
----- DOCUMENTATION -----
721-
Description of the exception
722-
----- DONE -----
723-
Defining name: <DefiningName "Test_Exception" exceptions.ads:4:4-4:18>
724-
Origin: <Id "Test_Exception" exceptions_package.adb:8:16-8:30>
725-
----- CODE SNIPPET -----
726-
Test_Exception : exception;
727-
----- DOCUMENTATION -----
728-
Description of the exception
729-
----- DONE -----
730779
Defining name: <DefiningName "Packages_Renaming" packages_renaming.ads:7:9-7:26>
731780
Origin: <Id "Packages_Renaming" packages_renaming.ads:7:9-7:26>
732781
----- CODE SNIPPET -----

0 commit comments

Comments
 (0)