fix: Fix TokenStream::to_string implementation dropping quotation marks

This commit is contained in:
Lukas Wirth 2024-08-29 08:41:43 +02:00
parent d6666b16c4
commit abed6e24a8
2 changed files with 8 additions and 3 deletions

View file

@ -507,12 +507,17 @@ mod tests {
close: span,
kind: tt::DelimiterKind::Brace,
},
token_trees: Box::new([]),
token_trees: Box::new([tt::TokenTree::Leaf(tt::Leaf::Literal(tt::Literal {
kind: tt::LitKind::Str,
symbol: Symbol::intern("string"),
suffix: None,
span,
}))]),
}),
],
};
assert_eq!(s.to_string(), "struct T {}");
assert_eq!(s.to_string(), "struct T {\"string\"}");
}
#[test]