summaryrefslogtreecommitdiffstats
path: root/vendor/proc-macro2/tests
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:31 +0000
commit2ff14448863ac1a1dd9533461708e29aae170c2d (patch)
tree85b9fea2bbfe3f06473cfa381eed11f273b57c5c /vendor/proc-macro2/tests
parentAdding debian version 1.64.0+dfsg1-1. (diff)
downloadrustc-2ff14448863ac1a1dd9533461708e29aae170c2d.tar.xz
rustc-2ff14448863ac1a1dd9533461708e29aae170c2d.zip
Adding debian version 1.65.0+dfsg1-2.debian/1.65.0+dfsg1-2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/proc-macro2/tests')
-rw-r--r--vendor/proc-macro2/tests/comments.rs2
-rw-r--r--vendor/proc-macro2/tests/test.rs9
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();