Sha256: 353c6c181f4ad322a5902d8afb7038bd2a840fc26e34a62ec1cb45a1665fb509

Contents?: true

Size: 1.01 KB

Versions: 26

Compression:

Stored size: 1.01 KB

Contents

import unittest

from grains import on_square, total_after


class GrainsTest(unittest.TestCase):
    def test_square_1(self):
        self.assertEqual(1, on_square(1))
        self.assertEqual(1, total_after(1))

    def test_square_2(self):
        self.assertEqual(2, on_square(2))
        self.assertEqual(3, total_after(2))

    def test_square_3(self):
        self.assertEqual(4, on_square(3))
        self.assertEqual(7, total_after(3))

    def test_square_4(self):
        self.assertEqual(8, on_square(4))
        self.assertEqual(15, total_after(4))

    def test_square_16(self):
        self.assertEqual(32768, on_square(16))
        self.assertEqual(65535, total_after(16))

    def test_square_32(self):
        self.assertEqual(2147483648, on_square(32))
        self.assertEqual(4294967295, total_after(32))

    def test_square_64(self):
        self.assertEqual(9223372036854775808, on_square(64))
        self.assertEqual(18446744073709551615, total_after(64))

if __name__ == '__main__':
    unittest.main()

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
trackler-2.0.3.0 tracks/python/exercises/grains/grains_test.py
trackler-2.0.2.0 tracks/python/exercises/grains/grains_test.py
trackler-2.0.1.2 tracks/python/exercises/grains/grains_test.py
trackler-2.0.1.1 tracks/python/exercises/grains/grains_test.py
trackler-2.0.1.0 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.10 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.9 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.8 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.7 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.6 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.5 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.4 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.3 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.2 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.1 tracks/python/exercises/grains/grains_test.py
trackler-2.0.0.0 tracks/python/exercises/grains/grains_test.py
trackler-1.0.4.1 tracks/python/exercises/grains/grains_test.py
trackler-1.0.4.0 tracks/python/exercises/grains/grains_test.py
trackler-1.0.3.0 tracks/python/exercises/grains/grains_test.py
trackler-1.0.2.1 tracks/python/exercises/grains/grains_test.py