MCPcopy Create free account
hub / github.com/daisy/MathCAT / at_left_edge

Function at_left_edge

src/xpath_functions.rs:1307–1319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1305
1306 #[test]
1307 fn at_left_edge() {
1308 let mathml = "<math><mfrac><mrow><mn>30</mn><mi>x</mi></mrow><mn>4</mn></mfrac></math>";
1309 let package = parser::parse(mathml).expect("failed to parse XML");
1310 let mathml = get_element(&package);
1311 trim_element(&mathml);
1312 let fraction = as_element(mathml.children()[0]);
1313 let mn = as_element(as_element(fraction.children()[0]).children()[0]);
1314 assert_eq!(EdgeNode::edge_node(mn, true, "2D"), Some(fraction));
1315 assert_eq!(EdgeNode::edge_node(mn, false, "2D"), None);
1316
1317 let mi = as_element(as_element(fraction.children()[0]).children()[1]);
1318 assert_eq!(EdgeNode::edge_node(mi, true, "2D"), None);
1319 }
1320
1321 #[test]
1322 fn at_right_edge() {

Callers

nothing calls this directly

Calls 3

get_elementFunction · 0.85
trim_elementFunction · 0.85
as_elementFunction · 0.85

Tested by

no test coverage detected