mirror of
https://gitee.com/openharmony/third_party_rust_quote
synced 2024-11-23 15:19:40 +00:00
Add test of boolean as a $literal
This commit is contained in:
parent
445781ee6a
commit
da9f24add0
@ -229,6 +229,34 @@ fn test_string() {
|
|||||||
assert_eq!(expected, tokens.to_string());
|
assert_eq!(expected, tokens.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_interpolated_literal() {
|
||||||
|
macro_rules! m {
|
||||||
|
($literal:literal) => {
|
||||||
|
quote!($literal)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
let tokens = m!(1);
|
||||||
|
let expected = "1";
|
||||||
|
assert_eq!(expected, tokens.to_string());
|
||||||
|
|
||||||
|
let tokens = m!(-1);
|
||||||
|
let expected = "- 1";
|
||||||
|
assert_eq!(expected, tokens.to_string());
|
||||||
|
|
||||||
|
// FIXME
|
||||||
|
/*
|
||||||
|
let tokens = m!(true);
|
||||||
|
let expected = "true";
|
||||||
|
assert_eq!(expected, tokens.to_string());
|
||||||
|
|
||||||
|
let tokens = m!(-true);
|
||||||
|
let expected = "- true";
|
||||||
|
assert_eq!(expected, tokens.to_string());
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_ident() {
|
fn test_ident() {
|
||||||
let foo = Ident::new("Foo", Span::call_site());
|
let foo = Ident::new("Foo", Span::call_site());
|
||||||
|
Loading…
Reference in New Issue
Block a user