Skip to content

Commit a491780

Browse files
committed
Add test of Display for TokenStream
1 parent 6225037 commit a491780

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,13 @@ fn test_debug_ident() {
718718
assert_eq!(expected, format!("{:?}", ident));
719719
}
720720

721+
#[test]
722+
fn test_display_tokenstream() {
723+
let tts = TokenStream::from_str("[a + 1]").unwrap();
724+
assert_eq!(format!("{tts}"), "[a + 1]");
725+
assert_eq!(format!("{tts:-^5}"), "[--a-- --+-- --1--]"); // FIXME
726+
}
727+
721728
#[test]
722729
fn test_debug_tokenstream() {
723730
let tts = TokenStream::from_str("[a + 1]").unwrap();

0 commit comments

Comments
 (0)