From 2400d70442364769b4ae18315fc178427d2d95a9 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 10 May 2020 06:22:26 +0800 Subject: Update cargo-metadata --- crates/ra_proc_macro_srv/Cargo.toml | 4 ++-- .../tests/fixtures/test_serialize_proc_macro.txt | 21 +++++---------------- crates/ra_proc_macro_srv/src/tests/mod.rs | 6 +++--- crates/ra_proc_macro_srv/src/tests/utils.rs | 6 +++--- 4 files changed, 13 insertions(+), 24 deletions(-) (limited to 'crates/ra_proc_macro_srv') diff --git a/crates/ra_proc_macro_srv/Cargo.toml b/crates/ra_proc_macro_srv/Cargo.toml index 886e14870..bb3003278 100644 --- a/crates/ra_proc_macro_srv/Cargo.toml +++ b/crates/ra_proc_macro_srv/Cargo.toml @@ -18,7 +18,7 @@ memmap = "0.7" test_utils = { path = "../test_utils" } [dev-dependencies] -cargo_metadata = "0.9.1" +cargo_metadata = "0.10.0" difference = "2.0.0" # used as proc macro test target -serde_derive = "=1.0.106" +serde_derive = "1.0.106" diff --git a/crates/ra_proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt b/crates/ra_proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt index 6776f5231..bc010cfe9 100644 --- a/crates/ra_proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt +++ b/crates/ra_proc_macro_srv/src/tests/fixtures/test_serialize_proc_macro.txt @@ -20,26 +20,15 @@ SUBTREE $ PUNCH = [alone] 4294967295 SUBTREE {} 4294967295 PUNCH # [alone] 4294967295 - SUBTREE [] 4294967295 - IDENT allow 4294967295 - SUBTREE () 4294967295 - IDENT unknown_lints 4294967295 - PUNCH # [alone] 4294967295 - SUBTREE [] 4294967295 - IDENT cfg_attr 4294967295 - SUBTREE () 4294967295 - IDENT feature 4294967295 - PUNCH = [alone] 4294967295 - LITERAL "cargo-clippy" 0 - PUNCH , [alone] 4294967295 - IDENT allow 4294967295 - SUBTREE () 4294967295 - IDENT useless_attribute 4294967295 - PUNCH # [alone] 4294967295 SUBTREE [] 4294967295 IDENT allow 4294967295 SUBTREE () 4294967295 IDENT rust_2018_idioms 4294967295 + PUNCH , [alone] 4294967295 + IDENT clippy 4294967295 + PUNCH : [joint] 4294967295 + PUNCH : [alone] 4294967295 + IDENT useless_attribute 4294967295 IDENT extern 4294967295 IDENT crate 4294967295 IDENT serde 4294967295 diff --git a/crates/ra_proc_macro_srv/src/tests/mod.rs b/crates/ra_proc_macro_srv/src/tests/mod.rs index 9cf58511c..82cefbb29 100644 --- a/crates/ra_proc_macro_srv/src/tests/mod.rs +++ b/crates/ra_proc_macro_srv/src/tests/mod.rs @@ -10,7 +10,7 @@ fn test_derive_serialize_proc_macro() { assert_expand( "serde_derive", "Serialize", - "1.0.106", + "1.0", r##"struct Foo {}"##, include_str!("fixtures/test_serialize_proc_macro.txt"), ); @@ -21,7 +21,7 @@ fn test_derive_serialize_proc_macro_failed() { assert_expand( "serde_derive", "Serialize", - "1.0.106", + "1.0", r##" struct {} "##, @@ -37,7 +37,7 @@ SUBTREE $ #[test] fn test_derive_proc_macro_list() { - let res = list("serde_derive", "1.0.106").join("\n"); + let res = list("serde_derive", "1.0").join("\n"); assert_eq_text!( &res, diff --git a/crates/ra_proc_macro_srv/src/tests/utils.rs b/crates/ra_proc_macro_srv/src/tests/utils.rs index 646a427c5..71436eee0 100644 --- a/crates/ra_proc_macro_srv/src/tests/utils.rs +++ b/crates/ra_proc_macro_srv/src/tests/utils.rs @@ -8,7 +8,7 @@ use std::str::FromStr; use test_utils::assert_eq_text; mod fixtures { - use cargo_metadata::{parse_messages, Message}; + use cargo_metadata::Message; use std::process::Command; // Use current project metadata to get the proc-macro dylib path @@ -19,12 +19,12 @@ mod fixtures { .unwrap() .stdout; - for message in parse_messages(command.as_slice()) { + for message in Message::parse_stream(command.as_slice()) { match message.unwrap() { Message::CompilerArtifact(artifact) => { if artifact.target.kind.contains(&"proc-macro".to_string()) { let repr = format!("{} {}", crate_name, version); - if artifact.package_id.repr.starts_with(&repr) { + if artifact.package_id.repr.starts_with(dbg!(&repr)) { return artifact.filenames[0].clone(); } } -- cgit v1.2.3 From 3de3b52f10d6881a5e6cb5ccc6d6321eea9175fa Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Sun, 10 May 2020 06:39:36 +0800 Subject: Remove dbg --- crates/ra_proc_macro_srv/src/tests/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_proc_macro_srv') diff --git a/crates/ra_proc_macro_srv/src/tests/utils.rs b/crates/ra_proc_macro_srv/src/tests/utils.rs index 71436eee0..84348b5de 100644 --- a/crates/ra_proc_macro_srv/src/tests/utils.rs +++ b/crates/ra_proc_macro_srv/src/tests/utils.rs @@ -24,7 +24,7 @@ mod fixtures { Message::CompilerArtifact(artifact) => { if artifact.target.kind.contains(&"proc-macro".to_string()) { let repr = format!("{} {}", crate_name, version); - if artifact.package_id.repr.starts_with(dbg!(&repr)) { + if artifact.package_id.repr.starts_with(&repr) { return artifact.filenames[0].clone(); } } -- cgit v1.2.3