Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make a more meaningful test for Punct eq
  • Loading branch information
dtolnay committed May 19, 2021
1 parent 3c16c0e commit faad7e2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions 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();
Expand All @@ -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, ':');
}

0 comments on commit faad7e2

Please sign in to comment.