diff --git a/pysr/test/test.py b/pysr/test/test.py index 8de3e8276..65d03ce36 100644 --- a/pysr/test/test.py +++ b/pysr/test/test.py @@ -99,6 +99,19 @@ def test_multiprocessing_turbo_custom_objective(self): # Test options stored: self.assertEqual(model.julia_options_.turbo, True) + def test_multiline_seval(self): + if jl.seval('VERSION >= v"1.9"'): + # The user should be able to run multiple things in a single seval call: + num = jl.seval( + """ + function my_new_objective(x) + x^2 + end + 1.5 + """ + ) + self.assertEqual(num, 1.5) + def test_high_precision_search_custom_loss(self): y = 1.23456789 * self.X[:, 0] model = PySRRegressor(