use pretty_assertions::assert_eq; use super::*; fn first_sourcepos(input: &str, sourcepos_chars: bool) -> Sourcepos { let arena = Arena::new(); let mut options = Options::default(); options.parse.sourcepos_chars = sourcepos_chars; let root = parse_document(&arena, input, &options); root.descendants() .find(|n| matches!(n.data().value, NodeValue::Paragraph)) .map(|n| n.data().sourcepos) .expect("no matching node found") } #[test] fn sourcepos_chars_one_byte() { const INPUT: &str = "a"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:1))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:1))); } #[test] fn sourcepos_chars_two_byte() { const INPUT: &str = "ษฝ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:2))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:1))); } #[test] fn sourcepos_chars_three_byte() { const INPUT: &str = "ๅฅฝ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:3))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:1))); } #[test] fn sourcepos_chars_four_byte() { const INPUT: &str = "๐€€"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:4))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:1))); } #[test] fn sourcepos_chars_multiple_one_byte_characters() { const INPUT: &str = "aaa"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:3))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:3))); } #[test] fn sourcepos_chars_multiple_two_byte_characters() { const INPUT: &str = "ษฝษฝษฝ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:6))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:3))); } #[test] fn sourcepos_chars_multiple_three_byte_characters() { const INPUT: &str = "ๅฅฝๅฅฝๅฅฝ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:9))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:3))); } #[test] fn sourcepos_chars_multiple_four_byte_characters() { const INPUT: &str = "๐€€๐€€๐€€"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:12))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:3))); } #[test] fn sourcepos_chars_multiple_mixed_characters() { const INPUT: &str = "aษฝๅฅฝ๐€€"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:10))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:4))); const REVERSED: &str = "๐€€ๅฅฝษฝa"; let sp2 = first_sourcepos(REVERSED, false); assert_eq!(sp2, sourcepos!((1:1-1:10))); let spc2 = first_sourcepos(REVERSED, true); assert_eq!(spc2, sourcepos!((1:1-1:4))); const MIXED: &str = "a๐€€ษฝๅฅฝ"; let sp3 = first_sourcepos(MIXED, false); assert_eq!(sp3, sourcepos!((1:1-1:10))); let spc3 = first_sourcepos(MIXED, true); assert_eq!(spc3, sourcepos!((1:1-1:4))); const REVERSED_MIXED: &str = "ๅฅฝษฝ๐€€a"; let sp4 = first_sourcepos(REVERSED_MIXED, false); assert_eq!(sp4, sourcepos!((1:1-1:10))); let spc4 = first_sourcepos(REVERSED_MIXED, true); assert_eq!(spc4, sourcepos!((1:1-1:4))); } #[test] fn sourcepos_chars_character_and_combining_characters() { const INPUT: &str = "eฬ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:3))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:2))); const THAI: &str = "เธเน‰เน‰เน‰"; let sp2 = first_sourcepos(THAI, false); assert_eq!(sp2, sourcepos!((1:1-1:12))); let spc2 = first_sourcepos(THAI, true); assert_eq!(spc2, sourcepos!((1:1-1:4))); } #[test] fn sourcepos_chars_emoji() { // heart without variation selector const ONLY_HEART: &str = "โค"; let sp = first_sourcepos(ONLY_HEART, false); assert_eq!(sp, sourcepos!((1:1-1:3))); let spc = first_sourcepos(ONLY_HEART, true); assert_eq!(spc, sourcepos!((1:1-1:1))); // heart + variation selector const HEART_WITH_VARIANT: &str = "โค๏ธ"; let sp = first_sourcepos(HEART_WITH_VARIANT, false); assert_eq!(sp, sourcepos!((1:1-1:6))); let spc = first_sourcepos(HEART_WITH_VARIANT, true); assert_eq!(spc, sourcepos!((1:1-1:2))); // family emoji with multiple code points const FAMILY: &str = "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"; let sp = first_sourcepos(FAMILY, false); assert_eq!(sp, sourcepos!((1:1-1:25))); let spc = first_sourcepos(FAMILY, true); assert_eq!(spc, sourcepos!((1:1-1:7))); // family emoji with skin tone modifiers const FAMILY_WITH_SKIN_TONES: &str = "๐Ÿ‘ฉ๐Ÿปโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ"; let sp = first_sourcepos(FAMILY_WITH_SKIN_TONES, false); assert_eq!(sp, sourcepos!((1:1-1:29))); let spc = first_sourcepos(FAMILY_WITH_SKIN_TONES, true); assert_eq!(spc, sourcepos!((1:1-1:8))); // flag emoji with regional indicator symbols const FLAG: &str = "๐Ÿ‡บ๐Ÿ‡ธ"; let sp = first_sourcepos(FLAG, false); assert_eq!(sp, sourcepos!((1:1-1:8))); let spc = first_sourcepos(FLAG, true); assert_eq!(spc, sourcepos!((1:1-1:2))); } #[test] fn sourcepos_chars_confusables() { const INPUT: &str = "๐™ฐA๐ดแ—…๐‘จ๐šจ๐•ฌ๐– ะฮ‘๐›ข๐–๐’œ๐œœ๐–ฝ€๐“๐ž๏ผก๐—”๐˜ˆแŽช๊“ฎ๐€๐”„๐”ธ๐Š ๐˜ผ"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:97))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:27))); } #[test] fn sourcepos_chars_rtl() { const INPUT: &str = "ืฉืœื•ื"; let sp = first_sourcepos(INPUT, false); assert_eq!(sp, sourcepos!((1:1-1:8))); let spc = first_sourcepos(INPUT, true); assert_eq!(spc, sourcepos!((1:1-1:4))); } #[test] fn sourcepos_chars_rtl_ltr_isolates() { const LTR_ISOLATE: &str = "A\u{2066}ืฉืœื•ื\u{2069}B"; let sp = first_sourcepos(LTR_ISOLATE, false); assert_eq!(sp, sourcepos!((1:1-1:16))); let spc = first_sourcepos(LTR_ISOLATE, true); assert_eq!(spc, sourcepos!((1:1-1:8))); const RTL_ISOLATE: &str = "A\u{2067}ืฉืœื•ื\u{2069}B"; let sp2 = first_sourcepos(RTL_ISOLATE, false); assert_eq!(sp2, sourcepos!((1:1-1:16))); let spc2 = first_sourcepos(RTL_ISOLATE, true); assert_eq!(spc2, sourcepos!((1:1-1:8))); } #[test] fn sourcepos_chars_one_byte_strong() { // Byte layout of "a**a**a" (7 bytes): a=1, **=2-3, a=4, **=5-6, a=7 assert_ast_match!( [], "a**a**a", (document (1:1-1:7) [ (paragraph (1:1-1:7) [ (text (1:1-1:1) "a") (strong (1:2-1:6) [ (text (1:4-1:4) "a") ]) (text (1:7-1:7) "a") ]) ]) ); // Char layout of "a**a**a" (7 chars): a=1, **=2-3, a=4, **=5-6, a=7 assert_ast_match!( [parse.sourcepos_chars], "a**a**a", (document (1:1-1:7) [ (paragraph (1:1-1:7) [ (text (1:1-1:1) "a") (strong (1:2-1:6) [ (text (1:4-1:4) "a") ]) (text (1:7-1:7) "a") ]) ]) ); } #[test] fn sourcepos_chars_two_byte_strong() { // Byte layout of "ษฝ**ษฝ**ษฝ" (10 bytes): ษฝ=1-2, **=3-4, ษฝ=5-6, **=7-8, ษฝ=9-10 assert_ast_match!( [], "ษฝ**ษฝ**ษฝ", (document (1:1-1:10) [ (paragraph (1:1-1:10) [ (text (1:1-1:2) "ษฝ") (strong (1:3-1:8) [ (text (1:5-1:6) "ษฝ") ]) (text (1:9-1:10) "ษฝ") ]) ]) ); // Char layout of "ษฝ**ษฝ**ษฝ" (7 chars): ษฝ=1, **=2-3, ษฝ=4, **=5-6, ษฝ=7 assert_ast_match!( [parse.sourcepos_chars], "ษฝ**ษฝ**ษฝ", (document (1:1-1:7) [ (paragraph (1:1-1:7) [ (text (1:1-1:1) "ษฝ") (strong (1:2-1:6) [ (text (1:4-1:4) "ษฝ") ]) (text (1:7-1:7) "ษฝ") ]) ]) ); } #[test] fn sourcepos_chars_three_byte_strong() { // Byte layout of "ๅฅฝ**ๅฅฝ**ๅฅฝ" (13 bytes): ๅฅฝ=1-3, **=4-5, ๅฅฝ=6-8, **=9-10, ๅฅฝ=11-13 assert_ast_match!( [], "ๅฅฝ**ๅฅฝ**ๅฅฝ", (document (1:1-1:13) [ (paragraph (1:1-1:13) [ (text (1:1-1:3) "ๅฅฝ") (strong (1:4-1:10) [ (text (1:6-1:8) "ๅฅฝ") ]) (text (1:11-1:13) "ๅฅฝ") ]) ]) ); // Char layout of "ๅฅฝ**ๅฅฝ**ๅฅฝ" (7 chars): ๅฅฝ=1, **=2-3, ๅฅฝ=4, **=5-6, ๅฅฝ=7 assert_ast_match!( [parse.sourcepos_chars], "ๅฅฝ**ๅฅฝ**ๅฅฝ", (document (1:1-1:7) [ (paragraph (1:1-1:7) [ (text (1:1-1:1) "ๅฅฝ") (strong (1:2-1:6) [ (text (1:4-1:4) "ๅฅฝ") ]) (text (1:7-1:7) "ๅฅฝ") ]) ]) ); } #[test] fn sourcepos_chars_four_byte_strong() { // Byte layout of "๐€€**๐€€**๐€€" (16 bytes): ๐€€=1-4, **=5-6, ๐€€=7-10, **=11-12, ๐€€=13-16 assert_ast_match!( [], "๐€€**๐€€**๐€€", (document (1:1-1:16) [ (paragraph (1:1-1:16) [ (text (1:1-1:4) "๐€€") (strong (1:5-1:12) [ (text (1:7-1:10) "๐€€") ]) (text (1:13-1:16) "๐€€") ]) ]) ); // Char layout of "๐€€**๐€€**๐€€" (7 chars): ๐€€=1, **=2-3, ๐€€=4, **=5-6, ๐€€=7 assert_ast_match!( [parse.sourcepos_chars], "๐€€**๐€€**๐€€", (document (1:1-1:7) [ (paragraph (1:1-1:7) [ (text (1:1-1:1) "๐€€") (strong (1:2-1:6) [ (text (1:4-1:4) "๐€€") ]) (text (1:7-1:7) "๐€€") ]) ]) ); } #[test] fn sourcepos_chars_alerts() { assert_ast_match!( [extension.alerts, extension.multiline_block_quotes], ">>> [!note]\n" "๐€€\n" ">>>\n", (document (1:1-3:3) [ (alert (1:1-2:4) [ (paragraph (2:1-2:4) [ (text (2:1-2:4) "๐€€") ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars, extension.alerts, extension.multiline_block_quotes], ">>> [!note]\n" "๐€€\n" ">>>\n", (document (1:1-3:3) [ (alert (1:1-2:1) [ (paragraph (2:1-2:1) [ (text (2:1-2:1) "๐€€") ]) ]) ]) ); } #[test] fn sourcepos_chars_cjk_friendly_emphasis() { assert_ast_match!( [extension.cjk_friendly_emphasis], "์Šคํฌ๋ฆฝํŠธ**์•ˆ๋…•**ํ•˜์„ธ์š”", (document (1:1-1:31) [ (paragraph (1:1-1:31) [ (text (1:1-1:12) "์Šคํฌ๋ฆฝํŠธ") (strong (1:13-1:22) [ (text (1:15-1:20) "์•ˆ๋…•") ]) (text (1:23-1:31) "ํ•˜์„ธ์š”") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars, extension.cjk_friendly_emphasis], "์Šคํฌ๋ฆฝํŠธ**์•ˆ๋…•**ํ•˜์„ธ์š”", (document (1:1-1:13) [ (paragraph (1:1-1:13) [ (text (1:1-1:4) "์Šคํฌ๋ฆฝํŠธ") (strong (1:5-1:10) [ (text (1:7-1:8) "์•ˆ๋…•") ]) (text (1:11-1:13) "ํ•˜์„ธ์š”") ]) ]) ); } #[test] fn sourcepos_chars_code() { // Inline code assert_ast_match!( [], "`๐€€`", (document (1:1-1:6) [ (paragraph (1:1-1:6) [ (code (1:1-1:6) "๐€€") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "`๐€€`", (document (1:1-1:3) [ (paragraph (1:1-1:3) [ (code (1:1-1:3) "๐€€") ]) ]) ); // Code block assert_ast_match!( [], "```\n๐€€\n```\n", (document (1:1-3:3) [ (code_block (1:1-3:3) "๐€€\n") ]) ); assert_ast_match!( [parse.sourcepos_chars], "```\n๐€€\n```\n", (document (1:1-3:3) [ (code_block (1:1-3:3) "๐€€\n") ]) ); } #[test] fn sourcepos_chars_frontmatter() { assert_ast_match!( [extension.front_matter_delimiter = Some("---".to_owned())], "---\ntitle: ๐€€\n---\n\n# ๐€€\n\n๐€€", (document (1:1-7:4) [ (frontmatter (1:1-3:3) "---\ntitle: ๐€€\n---\n\n") (heading (5:1-5:6) [ (text (5:3-5:6) "๐€€") ]) (paragraph (7:1-7:4) [ (text (7:1-7:4) "๐€€") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars, extension.front_matter_delimiter = Some("---".to_owned())], "---\ntitle: ๐€€\n---\n\n# ๐€€\n\n๐€€", (document (1:1-7:1) [ (frontmatter (1:1-3:3) "---\ntitle: ๐€€\n---\n\n") (heading (5:1-5:3) [ (text (5:3-5:3) "๐€€") ]) (paragraph (7:1-7:1) [ (text (7:1-7:1) "๐€€") ]) ]) ); } #[test] fn sourcepos_chars_link() { assert_ast_match!( [], "[๐€€](๐€)", (document (1:1-1:12) [ (paragraph (1:1-1:12) [ (link (1:1-1:12) "๐€" [ (text (1:2-1:5) "๐€€") ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "[๐€€](๐€)", (document (1:1-1:6) [ (paragraph (1:1-1:6) [ (link (1:1-1:6) "๐€" [ (text (1:2-1:2) "๐€€") ]) ]) ]) ); // Link with a title assert_ast_match!( [], "[๐€€](๐€ \"๐€‚\")", (document (1:1-1:19) [ (paragraph (1:1-1:19) [ (link (1:1-1:19) "๐€" [ (text (1:2-1:5) "๐€€") ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "[๐€€](๐€ \"๐€‚\")", (document (1:1-1:10) [ (paragraph (1:1-1:10) [ (link (1:1-1:10) "๐€" [ (text (1:2-1:2) "๐€€") ]) ]) ]) ); } #[test] fn sourcepos_chars_lists() { // Unordered list assert_ast_match!( [], "- ๐€€\n- ๐€\n", (document (1:1-2:6) [ (list (1:1-2:6) [ (item (1:1-1:6) [ (paragraph (1:3-1:6) [ (text (1:3-1:6) "๐€€") ]) ]) (item (2:1-2:6) [ (paragraph (2:3-2:6) [ (text (2:3-2:6) "๐€") ]) ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "- ๐€€\n- ๐€\n", (document (1:1-2:3) [ (list (1:1-2:3) [ (item (1:1-1:3) [ (paragraph (1:3-1:3) [ (text (1:3-1:3) "๐€€") ]) ]) (item (2:1-2:3) [ (paragraph (2:3-2:3) [ (text (2:3-2:3) "๐€") ]) ]) ]) ]) ); // Ordered list assert_ast_match!( [], "1. ๐€€\n2. ๐€\n", (document (1:1-2:7) [ (list (1:1-2:7) [ (item (1:1-1:7) [ (paragraph (1:4-1:7) [ (text (1:4-1:7) "๐€€") ]) ]) (item (2:1-2:7) [ (paragraph (2:4-2:7) [ (text (2:4-2:7) "๐€") ]) ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "1. ๐€€\n2. ๐€\n", (document (1:1-2:4) [ (list (1:1-2:4) [ (item (1:1-1:4) [ (paragraph (1:4-1:4) [ (text (1:4-1:4) "๐€€") ]) ]) (item (2:1-2:4) [ (paragraph (2:4-2:4) [ (text (2:4-2:4) "๐€") ]) ]) ]) ]) ); } #[test] fn sourcepos_chars_softbreak() { // Single-byte characters assert_ast_match!( [], "a\n" "b\n", (document (1:1-2:1) [ (paragraph (1:1-2:1) [ (text (1:1-1:1) "a") (softbreak (1:2-1:2)) (text (2:1-2:1) "b") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "a\n" "b\n", (document (1:1-2:1) [ (paragraph (1:1-2:1) [ (text (1:1-1:1) "a") (softbreak (1:2-1:2)) (text (2:1-2:1) "b") ]) ]) ); // Two-byte characters assert_ast_match!( [], "ษฝ\n" "ษพ\n", (document (1:1-2:2) [ (paragraph (1:1-2:2) [ (text (1:1-1:2) "ษฝ") (softbreak (1:3-1:3)) (text (2:1-2:2) "ษพ") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "ษฝ\n" "ษพ\n", (document (1:1-2:1) [ (paragraph (1:1-2:1) [ (text (1:1-1:1) "ษฝ") (softbreak (1:2-1:2)) (text (2:1-2:1) "ษพ") ]) ]) ); // Three-byte characters assert_ast_match!( [], "ๅฅฝ\n" "ๅฅพ\n", (document (1:1-2:3) [ (paragraph (1:1-2:3) [ (text (1:1-1:3) "ๅฅฝ") (softbreak (1:4-1:4)) (text (2:1-2:3) "ๅฅพ") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "ๅฅฝ\n" "ๅฅพ\n", (document (1:1-2:1) [ (paragraph (1:1-2:1) [ (text (1:1-1:1) "ๅฅฝ") (softbreak (1:2-1:2)) (text (2:1-2:1) "ๅฅพ") ]) ]) ); // Four-byte characters assert_ast_match!( [], "๐€€\n" "๐€\n", (document (1:1-2:4) [ (paragraph (1:1-2:4) [ (text (1:1-1:4) "๐€€") (softbreak (1:5-1:5)) (text (2:1-2:4) "๐€") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "๐€€\n" "๐€\n", (document (1:1-2:1) [ (paragraph (1:1-2:1) [ (text (1:1-1:1) "๐€€") (softbreak (1:2-1:2)) (text (2:1-2:1) "๐€") ]) ]) ); } #[test] fn sourcepos_chars_table() { assert_ast_match!( [extension.table], "| ๐€€ | ๐€ |\n" "| - | - |\n" "| ๐€‚ | ๐€ƒ |\n" , (document (1:1-3:15) [ (table (1:1-3:15) [ (table_row (1:1-1:15) [ (table_cell (1:2-1:7) [ (text (1:3-1:6) "๐€€") ]) (table_cell (1:9-1:14) [ (text (1:10-1:13) "๐€") ]) ]) (table_row (3:1-3:15) [ (table_cell (3:2-3:7) [ (text (3:3-3:6) "๐€‚") ]) (table_cell (3:9-3:14) [ (text (3:10-3:13) "๐€ƒ") ]) ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars, extension.table], "| ๐€€ | ๐€ |\n" "| - | - |\n" "| ๐€‚ | ๐€ƒ |\n" , (document (1:1-3:9) [ (table (1:1-3:9) [ (table_row (1:1-1:9) [ (table_cell (1:2-1:4) [ (text (1:3-1:3) "๐€€") ]) (table_cell (1:6-1:8) [ (text (1:7-1:7) "๐€") ]) ]) (table_row (3:1-3:9) [ (table_cell (3:2-3:4) [ (text (3:3-3:3) "๐€‚") ]) (table_cell (3:6-3:8) [ (text (3:7-3:7) "๐€ƒ") ]) ]) ]) ]) ); } #[test] fn sourcepos_chars_tasklist() { assert_ast_match!( [extension.tasklist], "- [x] ๐€€\n" " - [ ] ๐€\n" " - [x] ๐€‚\n" "- [ ] ๐€ƒ\n", (document (1:1-4:10) [ (list (1:1-4:10) [ (taskitem (1:1-3:12) [ (paragraph (1:7-1:10) [ (text (1:7-1:10) "๐€€") ]) (list (2:3-3:12) [ (taskitem (2:3-2:12) [ (paragraph (2:9-2:12) [ (text (2:9-2:12) "๐€") ]) ]) (taskitem (3:3-3:12) [ (paragraph (3:9-3:12) [ (text (3:9-3:12) "๐€‚") ]) ]) ]) ]) (taskitem (4:1-4:10) [ (paragraph (4:7-4:10) [ (text (4:7-4:10) "๐€ƒ") ]) ]) ]) ]) ); assert_ast_match!( [parse.sourcepos_chars, extension.tasklist], "- [x] ๐€€\n" " - [ ] ๐€\n" " - [x] ๐€‚\n" "- [ ] ๐€ƒ\n", (document (1:1-4:7) [ (list (1:1-4:7) [ (taskitem (1:1-3:9) [ (paragraph (1:7-1:7) [ (text (1:7-1:7) "๐€€") ]) (list (2:3-3:9) [ (taskitem (2:3-2:9) [ (paragraph (2:9-2:9) [ (text (2:9-2:9) "๐€") ]) ]) (taskitem (3:3-3:9) [ (paragraph (3:9-3:9) [ (text (3:9-3:9) "๐€‚") ]) ]) ]) ]) (taskitem (4:1-4:7) [ (paragraph (4:7-4:7) [ (text (4:7-4:7) "๐€ƒ") ]) ]) ]) ]) ); } #[test] fn sourcepos_chars_thematic_break() { assert_ast_match!( [], "๐€€\n\n" "---\n\n" "๐€\n", (document (1:1-5:4) [ (paragraph (1:1-1:4) [ (text (1:1-1:4) "๐€€") ]) (thematic_break (3:1-3:3)) (paragraph (5:1-5:4) [ (text (5:1-5:4) "๐€") ]) ]) ); assert_ast_match!( [parse.sourcepos_chars], "๐€€\n\n" "---\n\n" "๐€\n", (document (1:1-5:1) [ (paragraph (1:1-1:1) [ (text (1:1-1:1) "๐€€") ]) (thematic_break (3:1-3:3)) (paragraph (5:1-5:1) [ (text (5:1-5:1) "๐€") ]) ]) ); }