From 4b70c1efbe0510b2c8642141948c4158ec40fa45 Mon Sep 17 00:00:00 2001 From: Haydn Jones Date: Sat, 13 Jul 2024 16:10:45 -0400 Subject: [PATCH] Add long SELFIES test case --- tests/test_specific_cases.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_specific_cases.py b/tests/test_specific_cases.py index fb49c976..7bb2f39a 100644 --- a/tests/test_specific_cases.py +++ b/tests/test_specific_cases.py @@ -329,3 +329,12 @@ def test_old_symbols(): sf.decoder(long_s, compatible=True) except Exception: assert False + +def test_large_selfies_decoding(): + """Test that we can decode extremely large SELFIES strings (used to cause a RecursionError) + """ + + large_selfies = "[C]" * 1024 + expected_smiles = "C" * 1024 + + assert decode_eq(large_selfies, expected_smiles) \ No newline at end of file