diff --git a/ChronoHolographicCipher.ipynb b/ChronoHolographicCipher.ipynb index c9027ed..d510095 100644 --- a/ChronoHolographicCipher.ipynb +++ b/ChronoHolographicCipher.ipynb @@ -356,6 +356,45 @@ ], "execution_count": null, "outputs": [] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## UNIT TESTS" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import unittest\n", + "\n", + "class TestChronoHolographicCipher(unittest.TestCase):\n", + " def test_calculate_temporal_echo_simple(self):\n", + " cipher = ChronoHolographicCipher(resonance_factor=2, dimensions=2)\n", + " # dims = 2, R = 2\n", + " # n=1: 2^1 * (10 / 9) = 20/9\n", + " # n=2: 2^2 * (10 / 8) = 40/8 = 5\n", + " # expected = 10 + 20/9 + 5 = 15 + 2.222... = 17.22222222222222\n", + " result = cipher.calculate_temporal_echo(base_state_val=10, current_time=10)\n", + " self.assertAlmostEqual(result, 15 + 20/9, places=7)\n", + "\n", + " def test_calculate_temporal_echo_zero_dims(self):\n", + " cipher = ChronoHolographicCipher(resonance_factor=2, dimensions=0)\n", + " result = cipher.calculate_temporal_echo(base_state_val=10, current_time=10)\n", + " self.assertEqual(result, 10)\n", + "\n", + " def test_calculate_temporal_echo_zero_base(self):\n", + " cipher = ChronoHolographicCipher(resonance_factor=2, dimensions=2)\n", + " result = cipher.calculate_temporal_echo(base_state_val=0, current_time=10)\n", + " self.assertEqual(result, 0)\n", + "\n", + "if __name__ == '__main__':\n", + " unittest.main(argv=[''], exit=False)\n" + ] } ] } \ No newline at end of file