Skip to content

Commit 53341f3

Browse files
committed
Tests: Update tests and references
1 parent 020cf55 commit 53341f3

33 files changed

+182
-26
lines changed

tests/errors/test_dict_key4.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_dict_key4():
2+
print({[1, 2]: "first", [3, 4]: "second"})
3+
4+
test_dict_key4()

tests/errors/test_dict_key5.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_dict_key5():
2+
print({{1: "a", 2: "b"}: "first", {3: "c", 4: "d"}: "second"})
3+
4+
test_dict_key5()

tests/errors/test_dict_key6.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_dict_key6():
2+
print({{1, 2}: "first", {3, 4}: "second"})
3+
4+
test_dict_key6()

tests/errors/test_set_object4.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_set_object4():
2+
print({[1, 2], [3, 4]})
3+
4+
test_set_object4()

tests/errors/test_set_object5.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_set_object5():
2+
print({{1: "a", 2: "b"}, {3: "c", 4: "d"}})
3+
4+
test_set_object5()

tests/errors/test_set_object6.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def test_set_object6():
2+
print({{1, 2}, {3, 4}})
3+
4+
test_set_object6()

tests/reference/asr-test_dict7-1415e14.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-test_dict7-1415e14.stderr",
11-
"stderr_hash": "a51d1d4a46839e1f4258410e979ba83a14abe8c011482e30be2336cd",
11+
"stderr_hash": "843409ee199a2581d9cd1abab45bb59e5e0372d56ef94f1b15aea584",
1212
"returncode": 2
1313
}

tests/reference/asr-test_dict7-1415e14.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
semantic error: unhashable type in dict: 'slice'
1+
semantic error: Unhashable type in dict: 'slice'
22
--> tests/errors/test_dict7.py:4:11
33
|
44
4 | print(d[1:2])

tests/reference/asr-test_dict_key1-6e57a28.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"stdout": null,
99
"stdout_hash": null,
1010
"stderr": "asr-test_dict_key1-6e57a28.stderr",
11-
"stderr_hash": "ef02b1cd47e2290bcfb63a8e2d840795e9d40aa1c3b3f7f809239a25",
11+
"stderr_hash": "4ee828a6b9a93bfb8285c2006843243b5327f915f9548a2f1b3f1480",
1212
"returncode": 2
1313
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
semantic error: unhashable type: 'list'
2-
--> tests/errors/test_dict_key1.py:4:38
1+
semantic error: Unhashable type: 'list'
2+
--> tests/errors/test_dict_key1.py:4:19
33
|
44
4 | my_dict: dict[list[i32], str] = {[1, 2]: "first", [3, 4]: "second"}
5-
| ^^^^^^
5+
| ^^^^^^^^^ Mutable type 'list' cannot become a key in dict. Hint: Use an immutable type for key.

0 commit comments

Comments
 (0)