summaryrefslogtreecommitdiff
path: root/test/rat_tests-parse_graphs.adb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rat_tests-parse_graphs.adb')
-rw-r--r--test/rat_tests-parse_graphs.adb66
1 files changed, 17 insertions, 49 deletions
diff --git a/test/rat_tests-parse_graphs.adb b/test/rat_tests-parse_graphs.adb
index 1a42ea6..5cc0edb 100644
--- a/test/rat_tests-parse_graphs.adb
+++ b/test/rat_tests-parse_graphs.adb
@@ -238,7 +238,7 @@ package body Rat_Tests.Parse_Graphs is
then
return Fail;
end if;
- My_Graph.Set_Root (VP_2, (1 => 4));
+ My_Graph.Set_Root ((1 => (VP_2, 4)));
if My_Graph.Reachable ((Noun_10, 10)) then
return Fail;
end if;
@@ -254,7 +254,7 @@ package body Rat_Tests.Parse_Graphs is
if not My_Graph.All_Reachable then
return Fail;
end if;
- My_Graph.Set_Root (VP_2, (1 => 4));
+ My_Graph.Set_Root ((1 => (VP_2, 4)));
if My_Graph.All_Reachable then
return Fail;
end if;
@@ -354,7 +354,7 @@ package body Rat_Tests.Parse_Graphs is
My_Graph.Include (Sen_1);
My_Graph.Include (Noun_1);
My_Graph.Include (Verb_2);
- My_Graph.Set_Root (Sen_1, (1 => 2));
+ My_Graph.Set_Root ((1 => (Sen_1, 2)));
if My_Graph.All_Reachable then
return Fail;
end if;
@@ -372,7 +372,7 @@ package body Rat_Tests.Parse_Graphs is
return Test_Result
is
use type My_Traits.Tokens.Token;
- use type Graphs.Finish_Array;
+ use type Graphs.Finished_Token_Array;
Paper : Graphs.Parse_Graph := Paper_Graph;
begin
if not Paper.Contains (Prep_5) then
@@ -384,11 +384,11 @@ package body Rat_Tests.Parse_Graphs is
then
return Fail;
end if;
- if Paper.Root_Finish_List /= (4, 7, 10) then
+ if Paper.Root_Elements /= ((Sen_1, 4), (Sen_1, 7), (Sen_1, 10)) then
return Fail;
end if;
Paper.Prune ((Sen_1, 7));
- if Paper.Root_Finish_List /= (4, 10) then
+ if Paper.Root_Elements /= ((Sen_1, 4), (Sen_1, 10)) then
return Fail;
end if;
Paper.Prune (Paper.Subgroups ((NP_1, 1)) (1));
@@ -404,7 +404,7 @@ package body Rat_Tests.Parse_Graphs is
is
My_Graph : Graphs.Parse_Graph := Paper_Graph;
begin
- My_Graph.Set_Root (VP_2, (1 => 4));
+ My_Graph.Set_Root ((1 => (VP_2, 4)));
if My_Graph.All_Reachable then
return Fail;
end if;
@@ -439,7 +439,7 @@ package body Rat_Tests.Parse_Graphs is
My_Graph : Graphs.Parse_Graph := Paper_Graph;
begin
My_Graph.Clear_Root;
- My_Graph.Set_Root (Sen_1, (4, 7, 10));
+ My_Graph.Set_Root (((Sen_1, 4), (Sen_1, 7), (Sen_1, 10)));
if not My_Graph.Has_Root then
return Fail;
end if;
@@ -462,47 +462,16 @@ package body Rat_Tests.Parse_Graphs is
end Clear_Root_Check;
- function Root_Token_Check
+ function Root_Elements_Check
return Test_Result
is
- use type My_Traits.Tokens.Token;
- begin
- if Paper_Graph.Root_Token /= Sen_1 or
- Small_Graph.Root_Token /= VP_2 or
- Slide_Graph.Root_Token /= PP_1
- then
- return Fail;
- end if;
- return Pass;
- end Root_Token_Check;
-
-
- function Root_Finish_List_Check
- return Test_Result
- is
- use type Graphs.Finish_Array;
- begin
- if Paper_Graph.Root_Finish_List /= (4, 7, 10) or
- Small_Graph.Root_Finish_List /= (1 => 4)
- then
- return Fail;
- end if;
- return Pass;
- end Root_Finish_List_Check;
-
-
- function Root_Element_Check
- return Test_Result
- is
- use type Graphs.Finished_Token;
+ use type Graphs.Finished_Token_Array;
begin
- if Paper_Graph.Root_Element (4) /= (Sen_1, 4) or
- Paper_Graph.Root_Element (10) /= (Sen_1, 10)
- then
+ if Paper_Graph.Root_Elements /= ((Sen_1, 4), (Sen_1, 7), (Sen_1, 10)) then
return Fail;
end if;
return Pass;
- end Root_Element_Check;
+ end Root_Elements_Check;
@@ -735,8 +704,7 @@ package body Rat_Tests.Parse_Graphs is
function Is_Root_Ambiguous_Check
return Test_Result is
begin
- if Graphs.Empty_Graph.Is_Root_Ambiguous or
- not Paper_Graph.Is_Root_Ambiguous or
+ if not Paper_Graph.Is_Root_Ambiguous or
Small_Graph.Is_Root_Ambiguous or
Slide_Graph.Is_Root_Ambiguous
then
@@ -871,7 +839,7 @@ begin
((Sen_1, 7), (PP_8, 10)));
-- i saw a man in the park with a bat
- Paper_Graph.Set_Root (Sen_1, (4, 7, 10));
+ Paper_Graph.Set_Root (((Sen_1, 4), (Sen_1, 7), (Sen_1, 10)));
@@ -882,7 +850,7 @@ begin
((Verb_2, 2), (NP_3, 4)));
-- saw a man
- Small_Graph.Set_Root (VP_2, (1 => 4));
+ Small_Graph.Set_Root ((1 => (VP_2, 4)));
@@ -893,7 +861,7 @@ begin
((Prep_1, 1), (NP_2, 3)));
-- in the park
- Slide_Graph.Set_Root (PP_1, (1 => 3));
+ Slide_Graph.Set_Root ((1 => (PP_1, 3)));
@@ -904,7 +872,7 @@ begin
((Verb_1, 1), (NP_2, 3)));
-- saw a man
- Slid_Small_Graph.Set_Root (VP_1, (1 => 3));
+ Slid_Small_Graph.Set_Root ((1 => (VP_1, 3)));
end Rat_Tests.Parse_Graphs;