-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from polystat/doc_tests
Doc tests
- Loading branch information
Showing
17 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...g/polystat/py2eo/transpiler/simple-tests/compound-statements/class/projection-sample.yaml
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 @@ | ||
enabled: True | ||
python: | | ||
def classCheck(): | ||
class c: | ||
field = 1 | ||
def test(): | ||
o = c() | ||
o.field = 2 | ||
return o.field == 2 | ||
return test() |
10 changes: 10 additions & 0 deletions
10
...sources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/for/for_doc_1.yaml
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,10 @@ | ||
enabled: True | ||
python: | | ||
def forDocOne(): | ||
x = 0 | ||
for i in range(4): | ||
x = x + i | ||
print(x) | ||
return x == 6 |
5 changes: 5 additions & 0 deletions
5
.../org/polystat/py2eo/transpiler/simple-tests/compound-statements/function-def/def_doc.yaml
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,5 @@ | ||
enabled: True | ||
python: | | ||
def defDoc(): | ||
def f(): return 5 | ||
return 5 == f() |
7 changes: 7 additions & 0 deletions
7
...resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/if/if_doc_1.yaml
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,7 @@ | ||
enabled: True | ||
python: | | ||
def ifDocTwo(): | ||
x = 1 | ||
if True: | ||
x = 2 | ||
return x == 2 |
12 changes: 12 additions & 0 deletions
12
...resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/if/if_doc_2.yaml
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 @@ | ||
enabled: True | ||
python: | | ||
def ifDocTwo(): | ||
x = 1 | ||
if True: | ||
x = 2 | ||
elif False: | ||
x = 3 | ||
else: | ||
x = 4 | ||
return x == 2 |
9 changes: 9 additions & 0 deletions
9
...resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/if/if_doc_3.yaml
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,9 @@ | ||
enabled: True | ||
python: | | ||
def ifDocThree(): | ||
a = 7 | ||
b = 6 | ||
x = a if a < b else b | ||
print(x) | ||
return x == 6 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/try/try_doc.yaml
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,11 @@ | ||
enabled: True | ||
python: | | ||
def tryDoc(): | ||
def f(a, b): | ||
try: | ||
return a | ||
finally: | ||
return b | ||
res = f(1,2) | ||
return res == 2 |
9 changes: 9 additions & 0 deletions
9
...urces/org/polystat/py2eo/transpiler/simple-tests/compound-statements/while/while_doc.yaml
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,9 @@ | ||
enabled: True | ||
python: | | ||
def whileDocTwo(): | ||
x = 1 | ||
while x < 100: | ||
x = 2 * x | ||
print(x) | ||
return x == 128 |
7 changes: 7 additions & 0 deletions
7
...ces/org/polystat/py2eo/transpiler/simple-tests/expressions/evaluation-order/eval_doc.yaml
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,7 @@ | ||
enabled: True | ||
python: | | ||
def evalDoc(): | ||
def f(a, b): return a + b | ||
x = (1 + 2) * f(3 + 4, 5) | ||
print(x) | ||
return x == 36 |
6 changes: 6 additions & 0 deletions
6
...org/polystat/py2eo/transpiler/simple-tests/expressions/evaluation-order/operator_doc.yaml
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,6 @@ | ||
enabled: True | ||
python: | | ||
def operatorSample(): | ||
x = 1 + 2 * 3 | ||
print(x) | ||
return x == 7 |
8 changes: 8 additions & 0 deletions
8
...t/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/lambda/lambda_doc.yaml
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,8 @@ | ||
enabled: True | ||
python: | | ||
def lambda1(): | ||
f = lambda x: x * 10 | ||
x = f(11) | ||
print(x) | ||
return x == 110 | ||
7 changes: 7 additions & 0 deletions
7
...urces/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign_doc.yaml
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,7 @@ | ||
enabled: True | ||
python: | | ||
def assignDocOne(): | ||
x = 1 | ||
x = x + 2 * 3 | ||
print(x) | ||
return x == 7 |
0b80540
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: