test_hull_source: a fingerprint tells nested empty lists apart

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-10-18 22:36:54 +02:00
commit 3c4ea230bc

View file

@ -465,6 +465,9 @@ class FingerprintTests(unittest.TestCase):
("a", (1.0, 2.5), [[0.0, 1.0, 2.0]], 4), ("a", (1.0, 2.5), [[0.0, 1.0], [2.0]], 3)):
self.assertNotEqual(base, hs.fingerprint(*other))
def test_a_list_of_two_empty_lists_is_not_one_list_holding_one(self):
self.assertNotEqual(hs.fingerprint([], []), hs.fingerprint([[]]))
def test_float_noise_below_five_decimals_and_a_negative_zero_do_not_change_it(self):
self.assertEqual(hs.fingerprint((1.0, 0.0)), hs.fingerprint((1.0 + 1e-8, -0.0)))
self.assertEqual(hs.fingerprint((-1e-9,)), hs.fingerprint((0.0,)))