예제 #1
0
 def test_remove_last(self):
     n = Node(1)
     ll = Linkedlist()
     self.assertEqual(ll.remove_last(), None)
     ll.insert_last(n)
     self.assertEqual(ll.remove_last(), n)
     self.assertEqual(ll.size, 0)
     n = Node(2)
     ll.insert_last(n)
     n = Node(3)
     ll.insert_last(n)
     self.assertEqual(ll.remove_last(), n)
예제 #2
0
 def test_get_last(self):
     n = Node(1)
     ll = Linkedlist()
     self.assertEqual(ll.get_last(), None)
     ll.insert_last(n)
     self.assertEqual(ll.get_last(), n)