Skip to content

Commit

Permalink
add python3.7 output variant
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Jun 13, 2023
1 parent 9d0f27d commit a063ff1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test-data/unit/semanal-errors.test
Original file line number Diff line number Diff line change
Expand Up @@ -362,81 +362,107 @@ main:2: error: "yield" outside function
1 = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues2]
(1) = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues3]
(1, 1) = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal

[case testInvalidLvalues4]
[1, 1] = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal

[case testInvalidLvalues6]
x = y = z = 1 # ok
x, (y, 1) = 1
[out]
main:2: error: cannot assign to literal
[out version==3.7]
main:2: error: can't assign to literal

[case testInvalidLvalues7]
x, [y, 1] = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal

[case testInvalidLvalues8]
x, [y, [z, 1]] = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal

[case testInvalidLvalues9]
x, (y) = 1 # ok
x, (y, (z, z)) = 1 # ok
x, (y, (z, 1)) = 1
[out]
main:3: error: cannot assign to literal
[out version==3.7]
main:3: error: can't assign to literal

[case testInvalidLvalues10]
x + x = 1
[out]
main:1: error: cannot assign to operator
[out version==3.7]
main:1: error: can't assign to operator
[out version>=3.10]
main:1: error: cannot assign to expression here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues11]
-x = 1
[out]
main:1: error: cannot assign to operator
[out version==3.7]
main:1: error: can't assign to operator
[out version>=3.10]
main:1: error: cannot assign to expression here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues12]
1.1 = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues13]
'x' = 1
[out]
main:1: error: cannot assign to literal
[out version==3.7]
main:1: error: can't assign to literal
[out version>=3.10]
main:1: error: cannot assign to literal here. Maybe you meant '==' instead of '='?

[case testInvalidLvalues14]
x() = 1
[out]
main:1: error: cannot assign to function call
[out version==3.7]
main:1: error: can't assign to function call
[out version>=3.10]
main:1: error: cannot assign to function call here. Maybe you meant '==' instead of '='?

Expand Down Expand Up @@ -898,6 +924,8 @@ def f(): pass
f() = 1 # type: int
[out]
main:3: error: cannot assign to function call
[out version==3.7]
main:3: error: can't assign to function call
[out version>=3.10]
main:3: error: cannot assign to function call here. Maybe you meant '==' instead of '='?

Expand Down Expand Up @@ -976,6 +1004,8 @@ a = 1
a() = None # type: int
[out]
main:2: error: cannot assign to function call
[out version==3.7]
main:2: error: can't assign to function call
[out version>=3.10]
main:2: error: cannot assign to function call here. Maybe you meant '==' instead of '='?

Expand Down Expand Up @@ -1291,6 +1321,8 @@ def f() -> None:
f() = 1 # type: int
[out]
main:3: error: cannot assign to function call
[out version==3.7]
main:3: error: can't assign to function call
[out version>=3.10]
main:3: error: cannot assign to function call here. Maybe you meant '==' instead of '='?

Expand Down
2 changes: 2 additions & 0 deletions test-data/unit/semanal-statements.test
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ def f(x, y) -> None:
del x, y + 1
[out]
main:2: error: cannot delete operator
[out version==3.7]
main:2: error: can't delete operator
[out version>=3.10]
main:2: error: cannot delete expression

Expand Down

0 comments on commit a063ff1

Please sign in to comment.