Sha256: f4690b72b1cc3a24ccaaadbfe97c4677d9e9c33bd38b5062b56c3113ef3229f1

Contents?: true

Size: 1.01 KB

Versions: 19

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(on_square(1), 1)
        self.assertEqual(total_after(1), 1)

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

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

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

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

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

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


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

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
trackler-2.0.8.46 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.45 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.44 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.43 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.42 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.41 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.40 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.39 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.38 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.37 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.36 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.35 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.34 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.33 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.32 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.31 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.30 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.29 tracks/python/exercises/grains/grains_test.py
trackler-2.0.8.28 tracks/python/exercises/grains/grains_test.py