Make a more meaningful test for Punct eq
This commit is contained in:
parent
3c16c0e1df
commit
faad7e209d
@ -1,4 +1,4 @@
|
|||||||
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() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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, ':');
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user