text
stringlengths 0
234
|
|---|
-- On ignore l'ajout si une étiquette du même nom existe déjà
|
Nouveau_Graphe := Trouver_Pointeur_Sommet (Graphe, Etiquette);
|
exception
|
when Sommet_Non_Trouve =>
|
Nouveau_Graphe := new T_Sommet;
|
Nouveau_Graphe.all := (Etiquette, null, Graphe);
|
Graphe := Nouveau_Graphe;
|
Function Definition: procedure Main is
|
Function Body: Fail_Cnt : Natural := 0;
|
Pass_Cnt : Natural := 0;
|
procedure Test (Str : String;
|
Expected_Error : String := "";
|
Allow_Custom : Boolean := False);
|
procedure Test (Str : String;
|
Expected_Error : String := "";
|
Allow_Custom : Boolean := False)
|
is
|
begin
|
declare
|
Exp : constant SPDX.Expression := SPDX.Parse (Str, Allow_Custom);
|
Error : constant String :=
|
(if SPDX.Valid (Exp) then "" else SPDX.Error (Exp));
|
begin
|
if Error /= Expected_Error then
|
Put_Line ("FAIL: '" & Str & "'");
|
if Expected_Error /= "" then
|
Put_Line (" Expected error: '" & Expected_Error & "'");
|
Put_Line (" but got : '" & Error & "'");
|
else
|
Put_Line (" Unexpected error: '" & Error & "'");
|
end if;
|
Fail_Cnt := Fail_Cnt + 1;
|
elsif Expected_Error = ""
|
and then
|
Allow_Custom
|
and then
|
not SPDX.Has_Custom (Exp)
|
then
|
Put_Line ("FAIL: '" & Str & "'");
|
Put_Line (" Has_Custom returned False");
|
Fail_Cnt := Fail_Cnt + 1;
|
else
|
Put_Line ("PASS: '" & Str & "'");
|
Pass_Cnt := Pass_Cnt + 1;
|
end if;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.