Skip to content

Commit faad7e2

Browse files
committed
Make a more meaningful test for Punct eq
1 parent 3c16c0e commit faad7e2

File tree

1 file changed

+5
-5
lines changed
  • src/test/ui/proc-macro/auxiliary/api

1 file changed

+5
-5
lines changed

src/test/ui/proc-macro/auxiliary/api/cmp.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use proc_macro::{LineColumn, Punct};
1+
use proc_macro::{LineColumn, Punct, Spacing};
22

33
pub fn test() {
44
test_line_column_ord();
@@ -14,8 +14,8 @@ fn test_line_column_ord() {
1414
}
1515

1616
fn test_punct_eq() {
17-
// Good enough if it typechecks, since proc_macro::Punct can't exist in a test.
18-
fn _check(punct: Punct) {
19-
let _ = punct == ':';
20-
}
17+
let colon_alone = Punct::new(':', Spacing::Alone);
18+
assert_eq!(colon_alone, ':');
19+
let colon_joint = Punct::new(':', Spacing::Joint);
20+
assert_eq!(colon_joint, ':');
2121
}

0 commit comments

Comments
 (0)