diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-09-10 20:23:39 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-09-10 20:23:39 +0100 |
commit | 73b4fea01502ea7d4381f711cde5210cefcb4e00 (patch) | |
tree | 8b4a9d1ef764d82ccfdafdb2231a7813be09b01d /crates/ra_mbe/src/tests.rs | |
parent | 1140a83c1b393cdcd18e42d5d816fd8be348b059 (diff) | |
parent | 9eb14e11706ebf9a60b0afbe9bc82a99a816bc02 (diff) |
Merge #1810
1810: cleanup dollar handling in expressions r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_mbe/src/tests.rs')
-rw-r--r-- | crates/ra_mbe/src/tests.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index 0f07e935d..312fa4626 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -70,7 +70,7 @@ pub(crate) fn expand(rules: &MacroRules, invocation: &str) -> tt::Subtree { | |||
70 | 70 | ||
71 | pub(crate) fn expand_to_items(rules: &MacroRules, invocation: &str) -> ast::MacroItems { | 71 | pub(crate) fn expand_to_items(rules: &MacroRules, invocation: &str) -> ast::MacroItems { |
72 | let expanded = expand(rules, invocation); | 72 | let expanded = expand(rules, invocation); |
73 | token_tree_to_macro_items(&expanded).unwrap().tree() | 73 | token_tree_to_items(&expanded).unwrap().tree() |
74 | } | 74 | } |
75 | 75 | ||
76 | #[allow(unused)] | 76 | #[allow(unused)] |
@@ -155,8 +155,8 @@ pub(crate) fn assert_expansion( | |||
155 | let expected = text_to_tokentree(&expected); | 155 | let expected = text_to_tokentree(&expected); |
156 | let (expanded_tree, expected_tree) = match kind { | 156 | let (expanded_tree, expected_tree) = match kind { |
157 | MacroKind::Items => { | 157 | MacroKind::Items => { |
158 | let expanded_tree = token_tree_to_macro_items(&expanded).unwrap().tree(); | 158 | let expanded_tree = token_tree_to_items(&expanded).unwrap().tree(); |
159 | let expected_tree = token_tree_to_macro_items(&expected).unwrap().tree(); | 159 | let expected_tree = token_tree_to_items(&expected).unwrap().tree(); |
160 | 160 | ||
161 | ( | 161 | ( |
162 | debug_dump_ignore_spaces(expanded_tree.syntax()).trim().to_string(), | 162 | debug_dump_ignore_spaces(expanded_tree.syntax()).trim().to_string(), |
@@ -410,7 +410,7 @@ fn test_expand_to_item_list() { | |||
410 | ", | 410 | ", |
411 | ); | 411 | ); |
412 | let expansion = expand(&rules, "structs!(Foo, Bar);"); | 412 | let expansion = expand(&rules, "structs!(Foo, Bar);"); |
413 | let tree = token_tree_to_macro_items(&expansion).unwrap().tree(); | 413 | let tree = token_tree_to_items(&expansion).unwrap().tree(); |
414 | assert_eq!( | 414 | assert_eq!( |
415 | format!("{:#?}", tree.syntax()).trim(), | 415 | format!("{:#?}", tree.syntax()).trim(), |
416 | r#" | 416 | r#" |