##// END OF EJS Templates
fix latex_transformer and add test
fix latex_transformer and add test

File last commit:

r9888:b84afae9
r9888:b84afae9
Show More
test_transformers.py
38 lines | 879 B | text/x-python | PythonLexer
/ tests / test_transformers.py
import io
import nose.tools as nt
from nose.tools import nottest
from converters.latex_transformer import remove_math_space
@nottest
def test_space(input, reference):
nt.assert_equal(remove_math_space(input),reference)
def test_evens():
unchanged = [
"""
you should be able to type
$ a single dollar and go to the line
it shouldn't be transformed.
"""
]
references = [
('$e$','$e$'),
('$ e $','$e$'),
('xxx$e^i$yyy','xxx$e^i$yyy'),
('xxx$ e^i $yyy','xxx$e^i$yyy'),
('xxx$e^i $yyy','xxx$e^i$yyy'),
('xxx$ e^i$yyy','xxx$e^i$yyy'),
('\$ e $ e $','\$ e $e$'),
('',''),
]
for k,v in references :
yield test_space, k,v
for unch in unchanged :
yield test_space, unch, unch