Example #1
0
 def test_trivial_two(self):
     A = [1, 2]
     B = 2
     self.assertEqual([2], solution(ListNode.from_list(A), B))
Example #2
0
 def test_example(self):
     A = [1, 2, 3, 4, 5]
     B = 2
     self.assertEqual([1, 2, 3, 5], solution(ListNode.from_list(A), B))
Example #3
0
 def test_basic(self):
     A = [1, 2, 3]
     B = 1
     self.assertEqual([1, 2], solution(ListNode.from_list(A), B))
Example #4
0
 def test_trivial_one(self):
     A = [1]
     B = 1
     self.assertEqual(None, solution(ListNode.from_list(A), B))
Example #5
0
 def test_trivial_one(self):
     A = [1]
     self.assertEqual([1], solution(ListNode.from_list(A)))
Example #6
0
 def test_trivial_none(self):
     A = []
     self.assertEqual(None, solution(ListNode.from_list(A)))
Example #7
0
 def test_complex_odd(self):
     A = [1, 2, 3, 4, 5, 6, 7]
     self.assertEqual([1, 7, 2, 6, 3, 5, 4], solution(ListNode.from_list(A)))
Example #8
0
 def test_complex_even(self):
     A = [1, 6, 2, 10, 3, 7, 9, 8]
     self.assertEqual([1, 8, 6, 9, 2, 7, 10, 3], solution(ListNode.from_list(A)))
Example #9
0
 def test_example(self):
     A = [1, 2, 3, 4]
     self.assertEqual([1, 4, 2, 3], solution(ListNode.from_list(A)))