X-Git-Url: http://git.scottworley.com/paperdoorknob/blobdiff_plain/a5f4539c4cc5954515e1256289784f1b174a5a16..131deef1eba442d6e05c2ff6c6f7669b4b9e2b24:/texfilter_test.py diff --git a/texfilter_test.py b/texfilter_test.py new file mode 100644 index 0000000..8b603a3 --- /dev/null +++ b/texfilter_test.py @@ -0,0 +1,24 @@ +# paperdoorknob: Print glowfic +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, version 3. + + +import unittest +from texfilter import ApplyTexFilters + + +class TestTexFilters(unittest.TestCase): + + def testStripNBSP(self) -> None: + self.assertEqual( + ApplyTexFilters("FixBareEmph", b'\\emph{Yes?}'), + b'\\hspace{0pt}\\emph{Yes?}') + self.assertEqual( + ApplyTexFilters("FixBareEmph", b'Reassuring.\n\n\\emph{Yes?}'), + b'Reassuring.\n\n\\hspace{0pt}\\emph{Yes?}') + + +if __name__ == '__main__': + unittest.main()