Startonix / Modular-AI

Advanced AI Training and Building Repository
0 stars 0 forks source link

Comprehensive Testing Suite #175

Open Startonix opened 1 month ago

Startonix commented 1 month ago

We'll write unit tests for the critical components of the system to ensure their functionality and reliability.

import unittest import numpy as np

class TestCoreMathOperations(unittest.TestCase): def test_tensor_product(self): A = np.array([1, 2]) B = np.array([3, 4]) result = CoreMathOperations.tensor_product(A, B) expected = np.tensordot(A, B, axes=0) np.testing.assert_array_equal(result, expected)

def test_modular_multiplication(self):
    A = 5
    B = 3
    mod = 2
    result = CoreMathOperations.modular_multiplication(A, B, mod)
    expected = (A * B) % mod
    self.assertEqual(result, expected)

Continue with other test cases...

if name == 'main': unittest.main()