use crate::{ast::*, parser::parse_markdown};

#[test]
fn html_entity1() {
    let doc = parse_markdown("&amp;").unwrap();
    assert_eq!(
        doc,
        Document {
            blocks: vec![Block::Paragraph(vec![Inline::Text("&".to_string())]),]
        }
    );
}

#[test]
fn html_entity2() {
    let doc = parse_markdown("&#32;").unwrap();
    assert_eq!(
        doc,
        Document {
            blocks: vec![Block::Paragraph(vec![Inline::Text(" ".to_string())]),]
        }
    );
}

#[test]
fn html_entity3() {
    let doc = parse_markdown("&#x20;").unwrap();
    assert_eq!(
        doc,
        Document {
            blocks: vec![Block::Paragraph(vec![Inline::Text(" ".to_string())]),]
        }
    );
}

#[test]
fn html_entity4() {
    let doc = parse_markdown("&unknownchar;").unwrap();
    assert_eq!(
        doc,
        Document {
            blocks: vec![Block::Paragraph(vec![Inline::Text(
                "&unknownchar;".to_string()
            )]),]
        }
    );
}
