Skip to content

Commit 64f4bfa

Browse files
committed
Add destructuring assignment tests for string.
1 parent 398b0e8 commit 64f4bfa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_assign.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def varfunc():
5858
assert 'x' in var
5959
assert var['x'] == 10
6060

61+
6162
global_var = {}
6263

6364

@@ -70,3 +71,17 @@ def test_assign_nonlocal_func_return():
7071

7172
assert 'x' in global_var
7273
assert global_var['x'] == 10
74+
75+
76+
def test_destructuring():
77+
a, b = (1, 2)
78+
assert a == 1 and b == 2
79+
80+
a, b, c = "\xe0\xdf\xe7"
81+
assert a == "à" and b == "ß" and c == "ç"
82+
83+
a, b, c = "\u0430\u0431\u0432"
84+
assert a == 'а' and b == 'б' and c == 'в'
85+
# TODO not supported yet
86+
# a, b, c = "\U0001d49c\U0001d49e\U0001d4b5"
87+
# assert a == '𝒜' and b == '𝒞' and c == '𝒵'

0 commit comments

Comments
 (0)