mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 22:54:00 +00:00
Make macros test order-resistant
This commit is contained in:
parent
56c369db48
commit
dfe84494c1
1 changed files with 7 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
use super::*;
|
use super::*;
|
||||||
|
use itertools::Itertools;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn macro_rules_are_globally_visible() {
|
fn macro_rules_are_globally_visible() {
|
||||||
|
@ -1171,11 +1172,15 @@ fn proc_attr(a: TokenStream, b: TokenStream) -> TokenStream { a }
|
||||||
);
|
);
|
||||||
|
|
||||||
let root = &def_map[def_map.root()].scope;
|
let root = &def_map[def_map.root()].scope;
|
||||||
let actual = root.legacy_macros().map(|(name, _)| format!("{name}\n")).collect::<String>();
|
let actual = root
|
||||||
|
.legacy_macros()
|
||||||
|
.sorted_by(|a, b| std::cmp::Ord::cmp(&a.0, &b.0))
|
||||||
|
.map(|(name, _)| format!("{name}\n"))
|
||||||
|
.collect::<String>();
|
||||||
|
|
||||||
expect![[r#"
|
expect![[r#"
|
||||||
macro20
|
|
||||||
legacy
|
legacy
|
||||||
|
macro20
|
||||||
proc_attr
|
proc_attr
|
||||||
"#]]
|
"#]]
|
||||||
.assert_eq(&actual);
|
.assert_eq(&actual);
|
||||||
|
|
Loading…
Reference in a new issue