<commit_before>from unittest import TestCase, main

from classes.semiring import semirings


class TestSemiringsBasicProperties(TestCase):


    def setUp(self):
        pass


    def tearDown(self):
        pass


    def test_zero(self):
        [S.zero() for S in semirings]


    def test_unity(self):
        [S.unity() for S in semirings]

    def test_eq(self):
        for S in semirings:
            self.assertEqual(S.zero(), S.zero())
            self.assertIsNot(S.zero(), S.zero())
            self.assertEqual(S.unity(), S.unity())
            self.assertIsNot(S.unity(), S.unity())

    def test_zero_mul_unity(self):
        for S in semirings:
            self.assertEqual(S.zero() * S.unity(), S.zero())
            self.assertEqual(S.unity() * S.zero(), S.zero())

    def test_zero_add_unity(self):
        for S in semirings:
            self.assertEqual(S.zero() + S.unity(), S.unity())
            self.assertEqual(S.unity() + S.zero(), S.unity())
<commit_msg>Added tests for 0+0 and 1*1<commit_after>from unittest import TestCase, main

from classes.semiring import semirings


class TestSemiringsBasicProperties(TestCase):


    def setUp(self):
        pass


    def tearDown(self):
        pass


    def test_zero(self):
        [S.zero() for S in semirings]


    def test_unity(self):
        [S.unity() for S in semirings]

    def test_eq(self):
        for S in semirings:
            self.assertEqual(S.zero(), S.zero())
            self.assertIsNot(S.zero(), S.zero())
            self.assertEqual(S.unity(), S.unity())
            self.assertIsNot(S.unity(), S.unity())

    def test_zero_add_zero(self):
        for S in semirings:
            self.assertEqual(S.zero() + S.zero(), S.zero())

    def test_unity_mul_unity(self):
        for S in semirings:
            self.assertEqual(S.unity() * S.unity(), S.unity())

    def test_zero_mul_unity(self):
        for S in semirings:
            self.assertEqual(S.zero() * S.unity(), S.zero())
            self.assertEqual(S.unity() * S.zero(), S.zero())

    def test_zero_add_unity(self):
        for S in semirings:
            self.assertEqual(S.zero() + S.unity(), S.unity())
            self.assertEqual(S.unity() + S.zero(), S.unity())

{'fraction_non_alphanumeric': 0.1406180026869682, 'fraction_numerical': 0.0017913121361397223, 'mean_word_length': 2.2852941176470587, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6195367', 'n_tokens_mistral': 732, 'n_tokens_neox': 703, 'n_words': 161}