1 //! Test that `$var:expr` captures function correctly.
3 use expect_test::expect;
5 use crate::macro_expansion_tests::check;
8 fn unary_minus_is_a_literal() {
11 macro_rules! m { ($x:literal) => (literal!();); ($x:tt) => (not_a_literal!();); }
18 macro_rules! m { ($x:literal) => (literal!();); ($x:tt) => (not_a_literal!();); }
22 /* error: leftover tokens */not_a_literal!();
28 fn test_expand_bad_literal() {
31 macro_rules! m { ($i:literal) => {}; }
35 macro_rules! m { ($i:literal) => {}; }
36 /* error: Failed to lower macro args to token tree */"#]],
41 fn test_empty_comments() {
44 macro_rules! m{ ($fmt:expr) => (); }
48 macro_rules! m{ ($fmt:expr) => (); }
49 /* error: expected Expr */