def test_9092_returns_9093(_9092: list, sol: Solution): assert sol.plus_one(_9092) == [ 9, 0, 9, 3, ]
def test_999_returns_1e3(_999: list, sol: Solution): assert sol.plus_one(_999) == [ 1, 0, 0, 0, ]
class TestPlusOne(unittest.TestCase): def setUp(self): self.solution = Solution() def test_leet_one(self): self.assertEqual(self.solution.plus_one([1, 2, 3]), [1, 2, 4]) def test_leet_two(self): self.assertEqual(self.solution.plus_one([4, 3, 2, 1]), [4, 3, 2, 2]) def test_mine_one(self): self.assertEqual(self.solution.plus_one([9]), [1, 0]) def test_mine_two(self): self.assertEqual(self.solution.plus_one([4, 3, 9]), [4, 4, 0]) def test_mine_three(self): self.assertEqual(self.solution.plus_one([10, 2]), [1, 0, 3])
def test_plus_one(self): solution = Solution() self.assertEqual(solution.plusOne([1, 2, 3]), [1, 2, 4]) self.assertEqual(solution.plusOne([4, 3, 2, 1]), [4, 3, 2, 2]) self.assertEqual(solution.plusOne([1, 2, 9]), [1, 3, 0]) self.assertEqual(solution.plusOne([9, 9, 9]), [1, 0, 0, 0]) self.assertEqual(solution.plusOne([]), [1]) self.assertEqual(solution.plusOne([0]), [1])
from plus_one import Solution sln = Solution() assert sln.plusOne([0]) == [1] assert sln.plusOne([5]) == [6] assert sln.plusOne([0, 9]) == [1, 0] assert sln.plusOne([9]) == [1, 0] assert sln.plusOne([0, 9, 9]) == [1, 0, 0] assert sln.plusOne([9, 9]) == [1, 0, 0]
def test_123_returns_124(_123: list, sol: Solution): assert sol.plus_one(_123) == [ 1, 2, 4, ]
def test_zero_returns_1(zero: list, sol: Solution): assert sol.plus_one(zero) == [ 1, ]
def sol(): return Solution()
def setUp(self): self.solution = Solution()