From 6da70e9579be1143b40f07eaedeb4beb837b4dac Mon Sep 17 00:00:00 2001 From: lola Date: Mon, 3 Nov 2025 15:46:39 -0800 Subject: [PATCH] add test for 'new' list subexpression case --- tests/syntax/test_basic.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/syntax/test_basic.py b/tests/syntax/test_basic.py index dd022b208..a7e57e8cd 100644 --- a/tests/syntax/test_basic.py +++ b/tests/syntax/test_basic.py @@ -65,6 +65,13 @@ def test_no_ego(): compileScenic("new Object") +def test_new_in_list_expression(): + compileScenic( + "objs = [new Object with allowCollisions True]\n" + "ego = new Object with allowCollisions True" + ) + + def test_ego_complex_assignment(): with pytest.raises(ScenicSyntaxError): compileScenic("(ego, thing1), thing2 = ((new Object at 1@1), 2), 3")