Skip to content

Commit

Permalink
Added test for consecutive punctuation in NodeName
Browse files Browse the repository at this point in the history
Signed-off-by: max <[email protected]>
  • Loading branch information
PizzasBear authored and vldm committed Nov 1, 2023
1 parent ee93ab6 commit 8f8f199
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 8f8f199

Please sign in to comment.