diff options
Diffstat (limited to 'vendor/proc-macro2/tests')
-rw-r--r-- | vendor/proc-macro2/tests/comments.rs | 2 | ||||
-rw-r--r-- | vendor/proc-macro2/tests/test.rs | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/vendor/proc-macro2/tests/comments.rs b/vendor/proc-macro2/tests/comments.rs index 71741080c..4f7236dea 100644 --- a/vendor/proc-macro2/tests/comments.rs +++ b/vendor/proc-macro2/tests/comments.rs @@ -1,3 +1,5 @@ +#![allow(clippy::assertions_on_result_states)] + use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree}; // #[doc = "..."] -> "..." diff --git a/vendor/proc-macro2/tests/test.rs b/vendor/proc-macro2/tests/test.rs index 86031db6a..16f775ed0 100644 --- a/vendor/proc-macro2/tests/test.rs +++ b/vendor/proc-macro2/tests/test.rs @@ -1,4 +1,4 @@ -#![allow(clippy::non_ascii_literal)] +#![allow(clippy::assertions_on_result_states, clippy::non_ascii_literal)] use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; use std::panic; @@ -548,6 +548,13 @@ fn default_tokenstream_is_empty() { } #[test] +fn tokenstream_size_hint() { + let tokens = "a b (c d) e".parse::<TokenStream>().unwrap(); + + assert_eq!(tokens.into_iter().size_hint(), (4, Some(4))); +} + +#[test] fn tuple_indexing() { // This behavior may change depending on https://github.com/rust-lang/rust/pull/71322 let mut tokens = "tuple.0.0".parse::<TokenStream>().unwrap().into_iter(); |