def test1(): x='''\ 1.java:5: class k is public, should be declared in a file named k.java public class k { ^ ''' y, r=jdep.parseErrorBlock(x.splitlines(True), 1) assert len(r)==0, (y, r) assert y.fileName=='1.java', y assert y.lineNumber==5, y assert string.join(y.lines, '')==x, y.lines
def test2(): x='''\ 1.java:5: class k is public, should be declared in a file named k.java public class k { ^ 1.java:3: package d does not exist import d.*; ^ ''' y, r=jdep.parseErrorBlock(x.splitlines(True), 1) assert len(r)==3, (y, r) assert y.fileName=='1.java', y assert y.lineNumber==5, y assert string.join(y.lines+r, '')==x