21 lines
No EOL
584 B
Python
21 lines
No EOL
584 B
Python
from xopp2py import parser, abstract_syntax
|
|
from xopp2oml import writer
|
|
import os
|
|
|
|
if __name__ == "__main__":
|
|
DATADIR = os.path.join(os.path.dirname(__file__), "test_data")
|
|
|
|
class DummyOutput:
|
|
def write(self, text: str):
|
|
pass
|
|
|
|
def parse(filename):
|
|
asyntax = parser.parseFile(os.path.join(DATADIR, filename))
|
|
writer.writeOML(asyntax, filename, "my_xopp", DummyOutput())
|
|
|
|
# Just see if these files parse without throwing an exception :)
|
|
parse("SmallXournalFile.xopp")
|
|
parse("TwoHiddenLayers.xopp")
|
|
|
|
|
|
print("Tests passed.") |