fixup! test_parse, test_block
This commit is contained in:
		
					parent
					
						
							
								0d7b19c3d4
							
						
					
				
			
			
				commit
				
					
						dc689f976f
					
				
			
		
					 1 changed files with 49 additions and 2 deletions
				
			
		
							
								
								
									
										51
									
								
								src/block.rs
									
										
									
									
									
								
							
							
						
						
									
										51
									
								
								src/block.rs
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -403,13 +403,31 @@ mod test {
 | 
			
		|||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn parse_blockquote_empty() {
 | 
			
		||||
        test_parse!(
 | 
			
		||||
            "> \n",
 | 
			
		||||
            (Enter(Container(Blockquote)), ">"),
 | 
			
		||||
            (Element(Blankline), "\n"),
 | 
			
		||||
            (Exit(Container(Blockquote)), ">"),
 | 
			
		||||
        );
 | 
			
		||||
        test_parse!(
 | 
			
		||||
            ">",
 | 
			
		||||
            (Enter(Container(Blockquote)), ">"),
 | 
			
		||||
            (Element(Blankline), ""),
 | 
			
		||||
            (Exit(Container(Blockquote)), ">"),
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn parse_code_block() {
 | 
			
		||||
        test_parse!(
 | 
			
		||||
            concat!(
 | 
			
		||||
                "```\n",
 | 
			
		||||
                "l0\n",
 | 
			
		||||
                "```", //
 | 
			
		||||
                "```\n",
 | 
			
		||||
                "\n",
 | 
			
		||||
                "para\n", //
 | 
			
		||||
            ),
 | 
			
		||||
            (Enter(Leaf(CodeBlock { fence_length: 3 })), "```"),
 | 
			
		||||
            (Element(Inline), ""),
 | 
			
		||||
| 
						 | 
				
			
			@ -479,7 +497,7 @@ mod test {
 | 
			
		|||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn block_container() {
 | 
			
		||||
    fn block_blockquote() {
 | 
			
		||||
        test_block!(
 | 
			
		||||
            concat!(
 | 
			
		||||
                "> a\n",    //
 | 
			
		||||
| 
						 | 
				
			
			@ -493,4 +511,33 @@ mod test {
 | 
			
		|||
            5,
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #[test]
 | 
			
		||||
    fn block_code_block_seq() {
 | 
			
		||||
        test_block!(
 | 
			
		||||
            concat!(
 | 
			
		||||
                "````  lang\n",
 | 
			
		||||
                "l0\n",
 | 
			
		||||
                "```\n",
 | 
			
		||||
                " l1\n",
 | 
			
		||||
                "````", //
 | 
			
		||||
            ),
 | 
			
		||||
            Block::Leaf(CodeBlock { fence_length: 4 }),
 | 
			
		||||
            "````",
 | 
			
		||||
            5,
 | 
			
		||||
        );
 | 
			
		||||
        test_block!(
 | 
			
		||||
            concat!(
 | 
			
		||||
                "```\n", //
 | 
			
		||||
                "a\n",   //
 | 
			
		||||
                "```\n", //
 | 
			
		||||
                "```\n", //
 | 
			
		||||
                "bbb\n", //
 | 
			
		||||
                "```\n", //
 | 
			
		||||
            ),
 | 
			
		||||
            Block::Leaf(CodeBlock { fence_length: 3 }),
 | 
			
		||||
            "```",
 | 
			
		||||
            3,
 | 
			
		||||
        );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue