Skip to content

Commit 35f867e

Browse files
authored
Merge pull request #394 from polystat/fixDjangoAndTodo
Add 2 tests
2 parents 8b870e8 + 3452500 commit 35f867e

File tree

4 files changed

+5
-17
lines changed

4 files changed

+5
-17
lines changed

transpiler/src/main/scala/org/polystat/py2eo/transpiler/PrintLinearizedMutableEOWithCage.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ object PrintLinearizedMutableEOWithCage {
7777
case _ : ImportModule => List()
7878
case _ : ImportSymbol => List()
7979
case _ : ImportAllSymbols => List()
80-
case ClassDef(name, bases, body, decorators, ann) if bases.length <= 1 && decorators.l.isEmpty =>
80+
case ClassDef(name, bases, body, decorators, ann) if decorators.l.isEmpty =>
8181
val Suite(l0, _) = GenericStatementPasses.simpleProcStatement(GenericStatementPasses.unSuite)(body)
8282
val l = l0.filter{ case Pass(_) => false case _ => true }
8383
val init : Option[FuncDef] = l0
@@ -98,6 +98,7 @@ object PrintLinearizedMutableEOWithCage {
9898
name ::
9999
"[]" :: indent(
100100
"newUID.ap 0 > x__id__" ::
101+
(init match { case None => "(goto (ap.@)).result > @" case Some(_) => "0 > nothing-here" }) ::
101102
"[x] > eq" ::
102103
" x__id__.eq (x.x__id__) > @" ::
103104
s"[$consArgs] > ap" ::

transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/class/multiple-inheritance.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
enabled: False
1+
enabled: True
22
python: |
33
def multiInh():
44
class c:

transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/attribute-reference/attribute-1.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.

transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-5.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
enabled: False
1+
enabled: True
22
python: |
33
def test7_2_1():
44
x = 0
@@ -8,7 +8,7 @@ python: |
88
class c:
99
attr = 1
1010
c.attr += 1
11-
checkTargetC = c.attr == 1
11+
checkTargetC = c.attr == 2
1212
1313
a = [0, 1]
1414
a[0] += 1

0 commit comments

Comments
 (0)