Skip to content

Commit ee76cf7

Browse files
author
Troy Melhase
committed
All tests passing.
1 parent 88f84ab commit ee76cf7

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

test/Class11.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Class11 {
2+
Integer x = 0;
3+
4+
String any() {
5+
return x.toString();
6+
}
7+
8+
public static void main(String[] args) {
9+
Class11 c = new Class11();
10+
System.out.println( c.any() );
11+
}
12+
13+
14+
}

test/Class7.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public static void main(String[] args) {
2121
System.out.println(a);
2222
System.out.println(b);
2323

24-
Class7 c = new Class7();
25-
c.x();
26-
c.y();
27-
c.z(3);
24+
Class7 d = new Class7();
25+
d.x();
26+
d.y();
27+
d.z(3);
2828
}
2929
}

test/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ j2py = ../bin/j2py
55

66

77
python_files := $(addsuffix .py, $(notdir $(basename $(wildcard *.java))))
8-
test_targets := $(notdir $(basename $(wildcard *.java)))
8+
test_targets := $(sort $(notdir $(basename $(wildcard *.java))))
99

1010

1111
.PHONY: all clean
@@ -34,7 +34,7 @@ parsers:
3434

3535

3636
%.py: %.class
37-
@$(j2py) -i $(addsuffix .java, $(basename $@)) -o $@ -d configs
37+
@$(j2py) -i $(addsuffix .java, $(basename $@)) -o $@ -c configs/__init__.py -d configs
3838

3939
%: %.py
4040
@bash -c "diff -q <($(python) $(addsuffix .py, $@)) <(java -ea $@)" && echo "[PASS] $@"

test/configs/GenericPairs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
from java2python.config import default
4+
5+
6+
moduleOutputSubs = default.moduleOutputSubs + [
7+
(r'import java\.util', r''),
8+
(r'first\ \=\ T\(\)', 'first = None'),
9+
(r'second\ \=\ S\(\)', 'second = None'),
10+
]

test/configs/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
modulePrologueHandlers = default.modulePrologueHandlers + [
77
'from configs.overloading import overloaded',
8+
'from abc import ABCMeta, abstractmethod',
89
]
910

1011

0 commit comments

Comments
 (0)