summaryrefslogtreecommitdiff
path: root/test/graph_tests-curses.adb
diff options
context:
space:
mode:
Diffstat (limited to 'test/graph_tests-curses.adb')
-rw-r--r--test/graph_tests-curses.adb90
1 files changed, 90 insertions, 0 deletions
diff --git a/test/graph_tests-curses.adb b/test/graph_tests-curses.adb
new file mode 100644
index 0000000..3667825
--- /dev/null
+++ b/test/graph_tests-curses.adb
@@ -0,0 +1,90 @@
+
+
+package body Graph_Tests.Curses is
+
+
+ function First_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ begin
+ if My_Complex_Graph.First /= My_Complex_Graph.To_Cursor (1) or
+ My_Nonempty_Graph.First /= My_Nonempty_Graph.To_Cursor (2)
+ then
+ return Fail;
+ end if;
+ return Pass;
+ end First_Check;
+
+
+ function Last_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ begin
+ if My_Complex_Graph.Last /= My_Complex_Graph.To_Cursor (10) or
+ My_Nonempty_Graph.Last /= My_Nonempty_Graph.To_Cursor (11)
+ then
+ return Fail;
+ end if;
+ return Pass;
+ end Last_Check;
+
+
+ function Next_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ begin
+ if Graphs.Next (My_Complex_Graph.To_Cursor (3)) /= My_Complex_Graph.To_Cursor (4) or
+ Graphs.Next (My_Complex_Graph.To_Cursor (10)) /= Graphs.No_Element
+ then
+ return Fail;
+ end if;
+ return Pass;
+ end Next_Check;
+
+
+ function Previous_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ begin
+ if Graphs.Previous (My_Complex_Graph.To_Cursor (6)) /= My_Complex_Graph.To_Cursor (5) or
+ Graphs.Previous (My_Complex_Graph.To_Cursor (1)) /= Graphs.No_Element
+ then
+ return Fail;
+ end if;
+ return Pass;
+ end Previous_Check;
+
+
+ function Follow_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ Start : Graphs.Cursor := My_Complex_Graph.To_Cursor (1);
+ begin
+ if Graphs.Follow (Start, (1, 1, 2)) /= My_Complex_Graph.To_Cursor (2) then
+ return Fail;
+ end if;
+ return Pass;
+ end Follow_Check;
+
+
+ function Cursor_To_Check
+ return Test_Result
+ is
+ use type Graphs.Cursor;
+ Start : Graphs.Cursor := My_Complex_Graph.To_Cursor (2);
+ begin
+ if Graphs.Cursor_To (Start, 9) /= My_Complex_Graph.To_Cursor (9) then
+ return Fail;
+ end if;
+ return Pass;
+ end Cursor_To_Check;
+
+
+end Graph_Tests.Curses;
+
+