2017-05-07 14:28:39 +02:00
|
|
|
import unittest
|
|
|
|
|
|
2021-01-31 16:49:12 -05:00
|
|
|
from alphametics import (
|
|
|
|
|
solve,
|
|
|
|
|
)
|
2017-05-07 14:28:39 +02:00
|
|
|
|
2020-10-15 12:46:24 -04:00
|
|
|
# Tests adapted from `problem-specifications//canonical-data.json`
|
2017-05-07 14:28:39 +02:00
|
|
|
|
2019-11-13 13:02:24 +01:00
|
|
|
|
2018-06-13 09:12:09 -04:00
|
|
|
class AlphameticsTest(unittest.TestCase):
|
2017-05-07 14:28:39 +02:00
|
|
|
|
2021-05-08 22:40:00 -07:00
|
|
|
# Utility functions
|
|
|
|
|
def assertRaisesWithMessage(self, exception):
|
|
|
|
|
return self.assertRaisesRegex(exception, r".+")
|
2018-02-19 22:44:38 +08:00
|
|
|
|
2017-05-07 14:28:39 +02:00
|
|
|
|
2019-11-13 13:02:24 +01:00
|
|
|
if __name__ == "__main__":
|
2017-05-07 14:28:39 +02:00
|
|
|
unittest.main()
|