Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion Lib/test/test_ast_jy.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,31 @@ def test_empty_init(self):
#ast.stmt()
#ast.unaryop()

class TestAstList(unittest.TestCase):
"""Supplementary tests for org.python.core.AstList"""

def test_concat(self):
# Issue gh-356 Java IndexOOB error on append
body = ast.parse('x=1; global y; y+=x*2').body # _ast.AstList
p = [ast.Pass(), ast.Break()] # PyList
x = body + p
self.assertEqual(x[-2:], p)

def test_append(self):
# Issue gh-356 Java IndexOOB error on append
body = ast.parse('x=1; global y; y+=x*2').body # _ast.AstList
p = [ast.Pass(), ast.Break()] # PyList
body += p
self.assertEqual(body[-2:], p)


#==============================================================================

def test_main(verbose=None):
test_classes = [TestCompile]
test_classes = [
TestCompile,
TestAstList
]
test_support.run_unittest(*test_classes)

if __name__ == "__main__":
Expand Down
5 changes: 3 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ New Features
deprecated for removal in Java 26. See https://github.com/jnr/jffi/issues/165

Jython 2.7.5a1 Bugs fixed
- [ GH-382 ] Java EE Servlet Namespace Has Been Changed From javax.servlet to jakarta.servlet
- [ GH-84 ] PyServlet Will Need To Use The jakarta.servlet Namespace #84
- [ GH-382 ] Java EE Servlet namespace changed from javax.servlet to jakarta.servlet
- [ GH-356 ] _ast.astlist.__add__ leads to Java exception
- [ GH-84 ] PyServlet will need to use the jakarta.servlet namespace


==============================================================================
Expand Down
Loading
Loading