From faad7e209deee6d09d335ca00c06d9f41bc040b5 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 29 Apr 2021 11:20:27 -0700 Subject: [PATCH] Make a more meaningful test for Punct eq --- src/test/ui/proc-macro/auxiliary/api/cmp.rs | 10 +++++----- 1 file 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 3d17e9e350e64..5784a6e5d94db 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, ':'); }