Skip to content

Commit

Permalink
add test for double list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Sep 1, 2022
1 parent 3a0c15b commit 9725f99
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test_asteval.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,9 @@ def test_list_comprehension(self):
self.isvalue('x', [0, 1, 4, 9])
self.interp('x = [i*i for i in range(6) if i > 1]')
self.isvalue('x', [4, 9, 16, 25])
self.interp('x = [(i, j*2) for i in range(6) for j in range(2)]')
self.isvalue('x', [(0, 0), (0, 2), (1, 0), (1, 2), (2, 0), (2, 2), (3, 0), (3, 2), (4, 0), (4, 2), (5, 0), (5, 2)])


def test_ifexp(self):
"""test if expressions"""
Expand Down

0 comments on commit 9725f99

Please sign in to comment.