-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
49 changed files
with
975 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun() -> bool: | ||
a: bool = True | ||
return a | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun() -> i32: | ||
a: i32 = 1 | ||
return a | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 2 | ||
# >>> code | ||
def fun() -> f64: | ||
a: f64 = 2.0 | ||
return a | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: int): | ||
assert a | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(b: i32) -> i32: | ||
a = b | ||
return a | ||
|
||
|
||
# >>> call | ||
fun(1) | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(c: Tuple[i32, i32]) -> i32: | ||
a, b = c | ||
return a | ||
|
||
|
||
# >>> call | ||
fun((1, 2)) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
class Point: | ||
x: i32 | ||
y: i32 | ||
|
||
def fun(a: Point) -> i32: | ||
return a.x | ||
|
||
|
||
# >>> call | ||
fun(Point()) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: i32, b: i32) -> i32: | ||
a += b | ||
return a | ||
|
||
|
||
# >>> call | ||
fun(2, 1) | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(a: i32, b: i32) -> i32: | ||
a -= b | ||
return a | ||
|
||
|
||
# >>> call | ||
fun(2, 1) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: f64, b: f64) -> f64: | ||
return a + b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(a: f64, b: f64) -> f64: | ||
return a - b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 2 | ||
# >>> code | ||
def fun(a: f64, b: f64) -> f64: | ||
return a * b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 3 | ||
# >>> code | ||
def fun(a: i32, b: i32) -> i32: | ||
return a << b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 4 | ||
# >>> code | ||
def fun(a: i32, b: i32) -> i32: | ||
return a ^ b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: bool, b: bool) -> bool: | ||
return a and b | ||
|
||
|
||
# >>> call | ||
fun(True, False) | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(a: bool, b: bool) -> bool: | ||
return a or b | ||
|
||
|
||
# >>> call | ||
fun(True, False) | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 2 | ||
# >>> code | ||
def fun(a: bool, b: bool, c: bool) -> bool: | ||
return a or b or c | ||
|
||
|
||
# >>> call | ||
fun(True, False, False) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def myfunction(a: f64, b: f64) -> f64: | ||
return a + b | ||
|
||
def fun(): | ||
return myfunction(1.0, 2.0) | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
@e(g, h, i=j) | ||
@f | ||
class a(b, c=d): | ||
"""docstring""" | ||
pass | ||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: i32, b: i32, c: i32, d: i32) -> bool: | ||
return a < b > c != d | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(): | ||
return a not in b | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(): | ||
return 1 | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 1 | ||
# >>> code | ||
def fun(): | ||
return 2.1 | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 2 | ||
# >>> code | ||
def fun(): | ||
return None | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 3 | ||
# >>> code | ||
def fun(): | ||
return True | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
||
# >>> case: 4 | ||
# >>> code | ||
def fun(): | ||
return False | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(a: i32, b: i32): | ||
del a, b | ||
|
||
|
||
# >>> call | ||
fun(1, 2) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(b: i32): | ||
return {a: a for a in range(10) if a > b} | ||
|
||
|
||
# >>> call | ||
fun(2) | ||
|
||
# >>> expected | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# >>> case: 0 | ||
# >>> code | ||
def fun(): | ||
return {1: 2, 3: 4} | ||
|
||
|
||
# >>> call | ||
fun() | ||
|
||
# >>> expected | ||
|
||
|
Oops, something went wrong.