Make a more meaningful test for Punct eq

上级 3c16c0e1
use proc_macro::{LineColumn, Punct}; use proc_macro::{LineColumn, Punct, Spacing};
pub fn test() { pub fn test() {
test_line_column_ord(); test_line_column_ord();
...@@ -14,8 +14,8 @@ fn test_line_column_ord() { ...@@ -14,8 +14,8 @@ fn test_line_column_ord() {
} }
fn test_punct_eq() { fn test_punct_eq() {
// Good enough if it typechecks, since proc_macro::Punct can't exist in a test. let colon_alone = Punct::new(':', Spacing::Alone);
fn _check(punct: Punct) { assert_eq!(colon_alone, ':');
let _ = punct == ':'; let colon_joint = Punct::new(':', Spacing::Joint);
} assert_eq!(colon_joint, ':');
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册