def test_add_frac(self): self.assertIs(fracs.cmp_frac(fracs.add_frac([1, 1], [1, 1]), [2, 1]), 0) self.assertIs(fracs.cmp_frac(fracs.add_frac([1, 2], [1, -2]), [0, 1]), 0) self.assertIs(fracs.cmp_frac(fracs.add_frac([1, 2], [1, 3]), [5, 6]), 0)
def test_add_frac(self): self.assertEqual(fracs.add_frac([1, 2], [1, 3]), [5, 6]) self.assertEqual(fracs.add_frac([-1, 2], [1, 3]), [-1, 6])
def test_add_frac(self): self.assertEqual(fracs.add_frac(f1, f2), [-1, 2]) self.assertEqual(fracs.add_frac(f2, f3), [3, 1]) self.assertEqual(fracs.add_frac(f3, f4), [12, 2])
def test_add_frac(self): self.assertEqual(fracs.add_frac(self.pierwszy, self.drugi), [8, 3])
def test_add_frac(self): self.assertEqual(fracs.add_frac([1, 2], [1, 3]), [5, 6]) self.assertEqual(fracs.add_frac([0, 2], [1, 3]), [1, 3]) self.assertEqual(fracs.add_frac([-1, 2], [1, 2]), [0, 0]) self.assertEqual(fracs.add_frac([1, 3], [1, 3]), [2, 3]) self.assertEqual(fracs.add_frac([49, 100], [51, 100]), [1, 1])
def test_add_frac(self): self.assertEqual(fracs.add_frac([1, 3], [1, 4]), [7, 12]) self.assertEqual(fracs.add_frac([2, 2], [1, 2]), [3, 2]) self.assertEqual(fracs.add_frac([5, 2], [1, 2]), [6, 2])