Skip to content
Snippets Groups Projects
Commit fbb1e825 authored by Vanessa Stehr's avatar Vanessa Stehr
Browse files

Add test for empty "per"

parent ab65ddfe
Branches
No related tags found
No related merge requests found
Pipeline #31563 passed
......@@ -91,6 +91,13 @@ def test_fraction():
assert len(tree.warnings) == 1
assert tree.warnings == [r'The dsi string contains more than one \per, does not match specs! Given string: \metre\per\metre\per\metre']
# empty fraction
with pytest.warns(RuntimeWarning, match=r'The dsi string contains a \\per missing a numerator or denominator! Given string: \\per\\one'):
tree = p.parse(r'\per\one')
assert tree.toLatex() == r'$$1$$'
assert not tree.valid
assert len(tree.warnings) == 1
def test_empty():
with pytest.warns(RuntimeWarning, match='Given D-SI string is empty!'):
assert p.parse('').toLatex() == ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment