From 8f8f199574105970a6a99dbfd56af3fa975822ed Mon Sep 17 00:00:00 2001 From: max Date: Wed, 1 Nov 2023 09:21:42 +0200 Subject: [PATCH] Added test for consecutive punctuation in NodeName Signed-off-by: max --- tests/test.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test.rs b/tests/test.rs index ebf4aeb..88794da 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -4,7 +4,9 @@ use eyre::Result; use proc_macro2::TokenStream; use quote::{quote, ToTokens}; use rstml::{ - node::{KeyedAttribute, KeyedAttributeValue, Node, NodeAttribute, NodeElement, NodeType}, + node::{ + KeyedAttribute, KeyedAttributeValue, Node, NodeAttribute, NodeElement, NodeName, NodeType, + }, parse2, Parser, ParserConfig, }; use syn::{parse_quote, token::Colon, Block, LifetimeParam, Pat, PatType, Token, TypeParam}; @@ -885,6 +887,12 @@ fn test_empty_input() -> Result<()> { Ok(()) } +#[test] +fn test_consecutive_puncts_in_name() { + let name: NodeName = parse_quote! { a--::..d }; + assert_eq!(name.to_string(), "a--::..d"); +} + fn get_element(nodes: &[Node], element_index: usize) -> &NodeElement { let Some(Node::Element(element)) = nodes.get(element_index) else { panic!("expected element")