From a8c9c882921c052be4e8ef65557c2946d013e425 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 15 Mar 2021 23:38:22 +0800 Subject: Add test for proc-macro meta info retrieval --- crates/proc_macro_srv/src/tests/mod.rs | 7 +++++++ crates/proc_macro_srv/src/tests/utils.rs | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'crates/proc_macro_srv/src') diff --git a/crates/proc_macro_srv/src/tests/mod.rs b/crates/proc_macro_srv/src/tests/mod.rs index fd54f8dfd..b4ab4c077 100644 --- a/crates/proc_macro_srv/src/tests/mod.rs +++ b/crates/proc_macro_srv/src/tests/mod.rs @@ -56,3 +56,10 @@ DummyTrait [CustomDerive]"#, &res ); } + +#[test] +fn test_version_check() { + let path = fixtures::dylib_path("proc_macro_test", "0.0.0"); + let info = proc_macro_api::read_dylib_info(&path).unwrap(); + assert!(info.version.1 >= 50); +} diff --git a/crates/proc_macro_srv/src/tests/utils.rs b/crates/proc_macro_srv/src/tests/utils.rs index 0484c3af4..f15381f0f 100644 --- a/crates/proc_macro_srv/src/tests/utils.rs +++ b/crates/proc_macro_srv/src/tests/utils.rs @@ -6,7 +6,7 @@ use proc_macro_api::ListMacrosTask; use std::str::FromStr; use test_utils::assert_eq_text; -mod fixtures { +pub mod fixtures { use cargo_metadata::Message; use std::path::PathBuf; use std::process::Command; -- cgit v1.2.3