()
| 751 | |
| 752 | #[test] |
| 753 | fn test_entities() { |
| 754 | // this forces initialization |
| 755 | set_rules_dir(super::super::abs_rules_dir_path()).unwrap(); |
| 756 | |
| 757 | let entity_str = set_mathml("<math><mrow><mo>−</mo><mi>𝕞</mi></mrow></math>".to_string()).unwrap(); |
| 758 | let converted_str = set_mathml("<math><mrow><mo>−</mo><mi>𝕞</mi></mrow></math>".to_string()).unwrap(); |
| 759 | |
| 760 | // need to remove unique ids |
| 761 | lazy_static! { |
| 762 | static ref ID_MATCH: Regex = Regex::new(r#"id='.+?' "#).unwrap(); |
| 763 | } |
| 764 | let entity_str = ID_MATCH.replace_all(&entity_str, ""); |
| 765 | let converted_str = ID_MATCH.replace_all(&converted_str, ""); |
| 766 | assert_eq!(entity_str, converted_str, "normal entity test failed"); |
| 767 | |
| 768 | |
| 769 | let entity_str = set_mathml("<math data-quot=\""value"\" data-apos=''value''><mi>XXX</mi></math>".to_string()).unwrap(); |
| 770 | let converted_str = set_mathml("<math data-quot='\"value\"' data-apos=\"'value'\"><mi>XXX</mi></math>".to_string()).unwrap(); |
| 771 | let entity_str = ID_MATCH.replace_all(&entity_str, ""); |
| 772 | let converted_str = ID_MATCH.replace_all(&converted_str, ""); |
| 773 | assert_eq!(entity_str, converted_str, "special entities quote test failed"); |
| 774 | |
| 775 | let entity_str = set_mathml("<math><mo><</mo><mo>></mo><mtext>&lt;</mtext></math>".to_string()).unwrap(); |
| 776 | let converted_str = set_mathml("<math><mo><</mo><mo>></mo><mtext>&lt;</mtext></math>".to_string()).unwrap(); |
| 777 | let entity_str = ID_MATCH.replace_all(&entity_str, ""); |
| 778 | let converted_str = ID_MATCH.replace_all(&converted_str, ""); |
| 779 | assert_eq!(entity_str, converted_str, "special entities <,>,& test failed"); |
| 780 | } |
| 781 | |
| 782 | |
| 783 | #[test] |
nothing calls this directly
no test coverage detected