inline: add quote test

This commit is contained in:
Noah Hellman 2023-04-03 20:52:50 +02:00
parent 0a501fec10
commit d171cbb516

View file

@ -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, " "),
);
}
} }