Make a more meaningful test for Punct eq

上级 3c16c0e1
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, ':');
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册