diff --git a/Cargo.toml b/Cargo.toml index 30dca74..f3eec51 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test_each_file" -version = "0.3.3" +version = "0.3.4" authors = ["Jonathan Brouwer ", "Julia Dijkstra"] description = "Generates a test for each file in a specified directory." keywords = ["test", "proc-macro"] diff --git a/examples/readme/duplicate_names/match.test b/examples/readme/duplicate_names/match.test new file mode 100644 index 0000000..e69de29 diff --git a/src/lib.rs b/src/lib.rs index 82308af..7918d99 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,5 @@ #![doc = include_str!("../README.md")] -use proc_macro2::{Ident, TokenStream}; +use proc_macro2::{Ident, Span, TokenStream}; use quote::{format_ident, quote}; use std::collections::{HashMap, HashSet}; use std::ffi::OsString; @@ -142,7 +142,7 @@ fn sanitize_ident(input: &str) -> Ident { if !is_xid_start(name.chars().next().expect("Name is not empty")) { format_ident!("test_{name}") } else { - format_ident!("{name}") + Ident::new_raw(&name, Span::call_site()) } }