about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2021-04-29 11:20:27 -0700
committerDavid Tolnay <dtolnay@gmail.com>2021-05-19 11:38:23 -0700
commitfaad7e209deee6d09d335ca00c06d9f41bc040b5 (patch)
tree675e834fcba0a9290348b0055dc124a674dfabcc
parent3c16c0e1df61755db2267897392529eb9451aa62 (diff)
downloadrust-faad7e209deee6d09d335ca00c06d9f41bc040b5.tar.gz
rust-faad7e209deee6d09d335ca00c06d9f41bc040b5.zip
Make a more meaningful test for Punct eq
-rw-r--r--src/test/ui/proc-macro/auxiliary/api/cmp.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/ui/proc-macro/auxiliary/api/cmp.rs b/src/test/ui/proc-macro/auxiliary/api/cmp.rs
index 3d17e9e350e..5784a6e5d94 100644
--- a/src/test/ui/proc-macro/auxiliary/api/cmp.rs
+++ b/src/test/ui/proc-macro/auxiliary/api/cmp.rs
@@ -1,4 +1,4 @@
-use proc_macro::{LineColumn, Punct};
+use proc_macro::{LineColumn, Punct, Spacing};
 
 pub fn test() {
     test_line_column_ord();
@@ -14,8 +14,8 @@ fn test_line_column_ord() {
 }
 
 fn test_punct_eq() {
-    // Good enough if it typechecks, since proc_macro::Punct can't exist in a test.
-    fn _check(punct: Punct) {
-        let _ = punct == ':';
-    }
+    let colon_alone = Punct::new(':', Spacing::Alone);
+    assert_eq!(colon_alone, ':');
+    let colon_joint = Punct::new(':', Spacing::Joint);
+    assert_eq!(colon_joint, ':');
 }