aboutsummaryrefslogtreecommitdiff
path: root/tests/test_attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_attr.rs')
-rw-r--r--tests/test_attr.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_attr.rs b/tests/test_attr.rs
new file mode 100644
index 0000000..fd67e2a
--- /dev/null
+++ b/tests/test_attr.rs
@@ -0,0 +1,22 @@
+use paste::paste;
+
+#[test]
+fn test_paste_cfg() {
+ macro_rules! m {
+ ($ret:ident, $width:expr) => {
+ paste! {
+ #[cfg(any(feature = "protocol_feature_" $ret:snake, target_pointer_width = "" $width))]
+ fn new() -> $ret { todo!() }
+ }
+ };
+ }
+
+ struct Paste;
+
+ #[cfg(target_pointer_width = "64")]
+ m!(Paste, 64);
+ #[cfg(target_pointer_width = "32")]
+ m!(Paste, 32);
+
+ let _ = new;
+}