示例#1
0
 def test_count_72(self):
     """
     Test the fast method with 72.
     """
     value: int = 72
     result: int = 21
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#2
0
 def test_count_459(self):
     """
     Test the fast method with 459.
     """
     value: int = 459
     result: int = 148
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#3
0
 def test_count_173(self):
     """
     Test the fast method with 173.
     """
     value: int = 173
     result: int = 55
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#4
0
 def test_count_6_645_243(self):
     """
     Test the fast method with 6645243.
     """
     value: int = 6_645_243
     result: int = 3_615_948
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#5
0
 def test_count_1_000_000_000_000_000_000(self):
     """
     Test the fast method with 1000000000000000000.
     """
     value: int = 1_000_000_000_000_000_000
     result: int = 264160473575034274
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#6
0
 def test_count_880_000(self):
     """
     Test the fast method with 880000.
     """
     value: int = 880_000
     result: int = 472_910
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#7
0
 def test_count_883_904(self):
     """
     Test the fast method with 883904.
     """
     value: int = 883_904
     result: int = 475_749
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#8
0
 def test_count_773_904(self):
     """
     Test the fast method with 773904.
     """
     value: int = 773_904
     result: int = 412_264
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#9
0
 def test_count_770_000(self):
     """
     Test the fast method with 770000.
     """
     value: int = 770_000
     result: int = 410_562
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#10
0
 def test_count_361_087(self):
     """
     Test the fast method with 361087.
     """
     value: int = 361_087
     result: int = 188_067
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#11
0
 def test_count_1719(self):
     """
     Test the fast method with 2645.
     """
     value: int = 2645
     result: int = 1113
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#12
0
 def test_count_666(self):
     """
     Test the fast method with 666.
     """
     value: int = 666
     result: int = 264
     self.assertEqual(
         count(value), result,
         f'Between 0 and {value}, there are {result} lucky numbers.')
示例#13
0
 def test_count_0(self):
     """
     Tests the simplest case, with 0.
     """
     self.assertEqual(count(0), 0,
                      'Between 0 and 0, there is 0 lucky numbers.')