inline: add quote test
This commit is contained in:
		
					parent
					
						
							
								0a501fec10
							
						
					
				
			
			
				commit
				
					
						d171cbb516
					
				
			
		
					 1 changed files with 43 additions and 0 deletions
				
			
		| 
						 | 
					@ -859,6 +859,7 @@ mod test {
 | 
				
			||||||
    use super::Atom::*;
 | 
					    use super::Atom::*;
 | 
				
			||||||
    use super::Container::*;
 | 
					    use super::Container::*;
 | 
				
			||||||
    use super::EventKind::*;
 | 
					    use super::EventKind::*;
 | 
				
			||||||
 | 
					    use super::QuoteType;
 | 
				
			||||||
    use super::Verbatim;
 | 
					    use super::Verbatim;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    macro_rules! test_parse {
 | 
					    macro_rules! test_parse {
 | 
				
			||||||
| 
						 | 
					@ -1305,4 +1306,46 @@ mod test {
 | 
				
			||||||
        test_parse!("word{}", (Str, "word"));
 | 
					        test_parse!("word{}", (Str, "word"));
 | 
				
			||||||
        test_parse!("word{ % comment % } trail", (Str, "word"), (Str, " trail"));
 | 
					        test_parse!("word{ % comment % } trail", (Str, "word"), (Str, " trail"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    #[test]
 | 
				
			||||||
 | 
					    fn quote() {
 | 
				
			||||||
 | 
					        test_parse!(
 | 
				
			||||||
 | 
					            "'a'",
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                Atom(Quote {
 | 
				
			||||||
 | 
					                    ty: QuoteType::Single,
 | 
				
			||||||
 | 
					                    left: true,
 | 
				
			||||||
 | 
					                }),
 | 
				
			||||||
 | 
					                "'",
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            (Str, "a"),
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                Atom(Quote {
 | 
				
			||||||
 | 
					                    ty: QuoteType::Single,
 | 
				
			||||||
 | 
					                    left: false,
 | 
				
			||||||
 | 
					                }),
 | 
				
			||||||
 | 
					                "'",
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					        test_parse!(
 | 
				
			||||||
 | 
					            " 'a' ",
 | 
				
			||||||
 | 
					            (Str, " "),
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                Atom(Quote {
 | 
				
			||||||
 | 
					                    ty: QuoteType::Single,
 | 
				
			||||||
 | 
					                    left: true,
 | 
				
			||||||
 | 
					                }),
 | 
				
			||||||
 | 
					                "'",
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            (Str, "a"),
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                Atom(Quote {
 | 
				
			||||||
 | 
					                    ty: QuoteType::Single,
 | 
				
			||||||
 | 
					                    left: false,
 | 
				
			||||||
 | 
					                }),
 | 
				
			||||||
 | 
					                "'",
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					            (Str, " "),
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue