aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_srv/src/tests/mod.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-08-14 23:19:47 +0100
committerJonas Schievink <[email protected]>2020-08-14 23:27:32 +0100
commitcb816b1ea87b24f34eeecfdd98aeeb629915d661 (patch)
tree4928418a4f8d49f030e0689131f4d48dd59dc555 /crates/proc_macro_srv/src/tests/mod.rs
parentc2594daf2974dbd4ce3d9b7ec72481764abaceb5 (diff)
Add a proc_macro_test crate
This exports all 3 kinds of proc macros and is useful for testing
Diffstat (limited to 'crates/proc_macro_srv/src/tests/mod.rs')
-rw-r--r--crates/proc_macro_srv/src/tests/mod.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/proc_macro_srv/src/tests/mod.rs b/crates/proc_macro_srv/src/tests/mod.rs
index 8e6f28abd..1a827cbd7 100644
--- a/crates/proc_macro_srv/src/tests/mod.rs
+++ b/crates/proc_macro_srv/src/tests/mod.rs
@@ -35,7 +35,7 @@ SUBTREE $
35 35
36#[test] 36#[test]
37fn test_derive_proc_macro_list() { 37fn test_derive_proc_macro_list() {
38 let res = list("serde_derive", "1.0").join("\n"); 38 let res = list("serde_derive", "1").join("\n");
39 39
40 assert_eq_text!( 40 assert_eq_text!(
41 &res, 41 &res,
@@ -43,3 +43,16 @@ fn test_derive_proc_macro_list() {
43Deserialize [CustomDerive]"# 43Deserialize [CustomDerive]"#
44 ); 44 );
45} 45}
46
47/// Tests that we find and classify non-derive macros correctly.
48#[test]
49fn list_test_macros() {
50 let res = list("proc_macro_test", "0.0.0").join("\n");
51
52 assert_eq_text!(
53 &res,
54 r#"function_like_macro [FuncLike]
55attribute_macro [Attr]
56DummyTrait [CustomDerive]"#
57 );
58}