-
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 #285 from polystat/more-tests
Added & refined tests
- Loading branch information
Showing
200 changed files
with
190 additions
and
13 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -3,6 +3,6 @@ python: | | |
def test(): | ||
class A: | ||
a = 123 | ||
x = A() | ||
return x.a.__class__ == int | ||
return x.a.__class__ == int |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...org/polystat/py2eo/transpiler/simple-tests/expressions/bitwise-operators/bitwise-and.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 bitwiseAnd(): | ||
a = 0b1101 | ||
return a & 0b0110 == 0b100 |
5 changes: 5 additions & 0 deletions
5
...org/polystat/py2eo/transpiler/simple-tests/expressions/bitwise-operators/bitwise-xor.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 bitwiseXor(): | ||
a = 0b10 | ||
return a ^ 0b11 == 1 |
5 changes: 5 additions & 0 deletions
5
.../org/polystat/py2eo/transpiler/simple-tests/expressions/bitwise-operators/bitwsie-or.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 bitwiseOr(): | ||
a = 0b1010 | ||
return a | 0b1100 == 0b1110 |
5 changes: 5 additions & 0 deletions
5
.../org/polystat/py2eo/transpiler/simple-tests/expressions/boolean-operators/booleanAnd.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 booleanAnd(): | ||
a = True | ||
return a and False == False |
5 changes: 5 additions & 0 deletions
5
.../org/polystat/py2eo/transpiler/simple-tests/expressions/boolean-operators/booleanNot.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 booleanNot(): | ||
a = False | ||
return not a |
5 changes: 5 additions & 0 deletions
5
...s/org/polystat/py2eo/transpiler/simple-tests/expressions/boolean-operators/booleanOr.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 booleanOr(): | ||
a = False | ||
return a or True |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
...ces/org/polystat/py2eo/transpiler/simple-tests/expressions/conditional/conditional-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,7 @@ | ||
enabled: False | ||
python: | | ||
def cond2(): | ||
b = 2 | ||
a = 1 == b if "asd" else 1 | ||
return a == 1 | ||
2 changes: 1 addition & 1 deletion
2
...r/simple-tests/displays/dict-display.yaml → ...-displays/dict-display-comprehension.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
enabled: False | ||
python: | | ||
def setDisplay(): | ||
def setDisplayComprehension(): | ||
l = { x : x * x for x in range(1, 6) if (x % 2) == 1 } | ||
return l == { 1 : 1, 3 : 9, 5 : 25 } | ||
5 changes: 5 additions & 0 deletions
5
.../polystat/py2eo/transpiler/simple-tests/expressions/dictionary-displays/dict-display.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: False | ||
python: | | ||
def setDisplayComprehension(): | ||
l = { 1 : "fst", 2 : "snd" } | ||
18 changes: 18 additions & 0 deletions
18
...tat/py2eo/transpiler/simple-tests/expressions/evaluation-order/evaluation-order-plus.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,18 @@ | ||
enabled: False | ||
python: | | ||
def evaluationOrder(): | ||
xlist = [] | ||
def fst(): | ||
xlist.append(1) | ||
return 1 | ||
def snd(): | ||
xlist.append(2) | ||
return 2 | ||
b = fst() + snd() | ||
return b == 3 and xlist[0] == 1 and xlist[1] == 2 | ||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...polystat/py2eo/transpiler/simple-tests/expressions/list-displays/list-simple-display.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 listDisplay(): | ||
l = [1, 2, 3] | ||
return True | ||
5 changes: 5 additions & 0 deletions
5
...ources/org/polystat/py2eo/transpiler/simple-tests/expressions/literals/float_literal.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 floatLiteral(): | ||
2.4 | ||
return True |
5 changes: 5 additions & 0 deletions
5
...esources/org/polystat/py2eo/transpiler/simple-tests/expressions/literals/int_literal.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 intLiteral(): | ||
2 | ||
return True |
5 changes: 5 additions & 0 deletions
5
...urces/org/polystat/py2eo/transpiler/simple-tests/expressions/literals/string_literal.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 stringLiteral(): | ||
"asf" | ||
return True |
6 changes: 6 additions & 0 deletions
6
...o/transpiler/simple-tests/expressions/parenthesized-forms/parenthesized-expression-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,6 @@ | ||
enabled: False | ||
python: | | ||
def test(): | ||
a = 5 | ||
b = 6 | ||
return (a + 5) * b == 60 |
7 changes: 7 additions & 0 deletions
7
...o/transpiler/simple-tests/expressions/parenthesized-forms/parenthesized-expression-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,7 @@ | ||
enabled: False | ||
python: | | ||
def test(): | ||
a = 5 | ||
b = 6 | ||
c = 13 | ||
return (a + b) / c == 1 |
4 changes: 4 additions & 0 deletions
4
...olystat/py2eo/transpiler/simple-tests/expressions/power-operator/arithmetics-integer.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,4 @@ | ||
enabled: True | ||
python: | | ||
def powerOperator(): | ||
return 10 ** 2 == 100 |
2 changes: 1 addition & 1 deletion
2
...er/simple-tests/displays/set-display.yaml → ...t-displays/set-display-comprehension.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
enabled: False | ||
python: | | ||
def setDisplay(): | ||
def setDisplayComprehension(): | ||
l = { x * x for x in range(1, 6) if (x % 2) == 1 } | ||
return l == { 1, 9, 25 } | ||
5 changes: 5 additions & 0 deletions
5
...rces/org/polystat/py2eo/transpiler/simple-tests/expressions/set-displays/set-display.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: False | ||
python: | | ||
def setDisplay(): | ||
l = { 1, 2, 3, 1 } | ||
5 changes: 5 additions & 0 deletions
5
.../polystat/py2eo/transpiler/simple-tests/expressions/shifting-operators/shifting-left.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 shiftingLeft(): | ||
a = 1 | ||
return a << 1 == 2 |
5 changes: 5 additions & 0 deletions
5
...polystat/py2eo/transpiler/simple-tests/expressions/shifting-operators/shifting-right.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 shiftingRight(): | ||
a = 3 | ||
return a >> 1 == 1 |
5 changes: 5 additions & 0 deletions
5
.../org/polystat/py2eo/transpiler/simple-tests/expressions/unary-operators/unary-invert.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: False | ||
python: | | ||
def unaryInvert(): | ||
a = 2 | ||
return ~a == -3 |
5 changes: 5 additions & 0 deletions
5
...s/org/polystat/py2eo/transpiler/simple-tests/expressions/unary-operators/unary-minus.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 unaryMinus(): | ||
a = 2 | ||
return -a + 2 == 0 |
5 changes: 5 additions & 0 deletions
5
...es/org/polystat/py2eo/transpiler/simple-tests/expressions/unary-operators/unary-plus.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 unaryPlus(): | ||
a = 2 | ||
return +a == 2 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions
6
...c/test/resources/org/polystat/py2eo/transpiler/simple-tests/library/list/list-append.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 listGet(): | ||
list = [1, 2, 3] | ||
list2 = list.append(4) | ||
return list[1] == 2 and list[3] == 4 |
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
.../src/test/resources/org/polystat/py2eo/transpiler/simple-tests/library/list/list-get.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 listGet(): | ||
list = [1,2, 3] | ||
return list[1] == 2 |
5 changes: 5 additions & 0 deletions
5
.../src/test/resources/org/polystat/py2eo/transpiler/simple-tests/library/list/list-len.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 listLen(): | ||
list = [1,2, 3] | ||
return len(list) == 3 |
5 changes: 5 additions & 0 deletions
5
...test/resources/org/polystat/py2eo/transpiler/simple-tests/library/print/print-string.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 printString(): | ||
print("Hello world!") | ||
return True |
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...spiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/parser/comments.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 comments(): | ||
# this comment doesn't interfere | ||
return True |
5 changes: 5 additions & 0 deletions
5
...st/resources/org/polystat/py2eo/transpiler/simple-tests/parser/explicit-line-joining.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: False | ||
python: | | ||
def comments(): | ||
return \ | ||
True |
4 changes: 4 additions & 0 deletions
4
...ler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/parser/indentation.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,4 @@ | ||
enabled: True | ||
python: | | ||
def indentation(): | ||
return True |
4 changes: 4 additions & 0 deletions
4
...ler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/parser/whitespaces.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,4 @@ | ||
enabled: True | ||
python: | | ||
def whitespaces(): | ||
return True |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions
5
...t/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/pass/pass-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,5 @@ | ||
enabled: True | ||
python: | | ||
def pass1(): | ||
pass | ||
return True |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
b00ffb7
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: