diff options
author | Jed Barber <jjbarber@y7mail.com> | 2020-05-21 21:24:25 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2020-05-21 21:24:25 +1000 |
commit | 82a42674ba64c6386152a5910fd7345a92b135e8 (patch) | |
tree | be453540ca12e0679f9ea741f99c592696ce3b96 /test/graph_tests-curses.adb | |
parent | d07979218ea80c58e64148d9638ed3e6195ff6ed (diff) |
Tests complete, minor bugs fixed
Diffstat (limited to 'test/graph_tests-curses.adb')
-rw-r--r-- | test/graph_tests-curses.adb | 90 |
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; + + |