use math_core::{Indentation, LatexToMathML, MathCoreConfig, MathDisplay, PrettyPrint};
#[test]
fn test_indentation_spaces() {
let config = MathCoreConfig {
pretty_print: PrettyPrint::Always,
indentation: Indentation::Spaces(2),
..Default::default()
};
let converter = LatexToMathML::new(config).unwrap();
let mathml = converter
.convert_with_local_state(r"\frac{1}{2}", MathDisplay::Block)
.unwrap()
.mathml;
assert!(mathml.contains("\n <mfrac>"), "output was:\n{mathml}");
assert!(!mathml.contains("\n <mfrac>"), "output was:\n{mathml}");
}
#[test]
fn test_indentation_tab() {
let config = MathCoreConfig {
pretty_print: PrettyPrint::Always,
indentation: Indentation::tab(),
..Default::default()
};
let converter = LatexToMathML::new(config).unwrap();
let mathml = converter
.convert_with_local_state(r"\frac{1}{2}", MathDisplay::Block)
.unwrap()
.mathml;
assert!(mathml.contains("\n\t<mfrac>"), "output was:\n{mathml}");
assert!(!mathml.contains("\n "), "output was:\n{mathml}");
}