Skip to content

Commit ba78bbb

Browse files
committed
Added test for consecutive punctuation in NodeName
Signed-off-by: max <[email protected]>
1 parent e533ffb commit ba78bbb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/test.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use eyre::Result;
44
use proc_macro2::TokenStream;
55
use quote::{quote, ToTokens};
66
use rstml::{
7-
node::{KeyedAttribute, KeyedAttributeValue, Node, NodeAttribute, NodeElement, NodeType},
7+
node::{
8+
KeyedAttribute, KeyedAttributeValue, Node, NodeAttribute, NodeElement, NodeName, NodeType,
9+
},
810
parse2, Parser, ParserConfig,
911
};
1012
use syn::{parse_quote, token::Colon, Block, LifetimeParam, Pat, PatType, Token, TypeParam};
@@ -885,6 +887,12 @@ fn test_empty_input() -> Result<()> {
885887
Ok(())
886888
}
887889

890+
#[test]
891+
fn test_consecutive_puncts_in_name() {
892+
let name: NodeName = parse_quote! { a--::..d };
893+
assert_eq!(name.to_string(), "a--::..d");
894+
}
895+
888896
fn get_element(nodes: &[Node], element_index: usize) -> &NodeElement {
889897
let Some(Node::Element(element)) = nodes.get(element_index) else {
890898
panic!("expected element")

0 commit comments

Comments
 (0)